# area of intersection between rotated rectangles

• 09-16-2009, 10:35 AM
bluekronos
area of intersection between rotated rectangles
hi guys
How would I go about finding the area of the intersection between two rectangles that may be rotated relative to each other? The information I have to work with is their coordinates (one centered, one top left aligned, but it wouldn't be hard to find the other center point if that's necessary), the width and height of each rectangle, and the angles they are rotated at.
• 09-17-2009, 07:02 PM
rachil0
One solution could be to (i) use the sutherland hodgman algorithm to clip one rectangle within the other, and then (ii) use greens theorem/the surveyors formula to compute the area. The second step is easy, but the first step requires a little bit of care to program correctly.

There might be a simpler solution, so be sure to ask around at some other places.
• 10-07-2009, 03:54 AM
realMakc
or use drawing api + blending modes + bitmap.draw + getColorBoundsRect per every scan line to estimate the area.
• 12-26-2009, 05:42 PM
ZippyDee
find the two intersection points and the two points for the corners, and then divide it into two triangles. That will make it a lot simpler.
• 04-20-2010, 02:11 PM
Suthers
This is really a Calculus problem, more specifically a study called INTEGRATION.