Moving ahead from previous question.I have two rectangle and they look like this:
struct Rect
{
NSPoint topLeft;
NSPoint topRight;
NSPoint bottomLeft;
NSPoint bottomRight;
}
I use something similar code to check whether rectangles intersects(or collision) . In case If 2 rectangles intersects I want to calculate the area of intersection in the first rectangle or the points where the second rectangle intersects with first rectangle (i.e. intersection coordinates).
How do I calculate the intersecting points or the area of intersection.