A Flash Developer Resource Site

# Thread: area of intersection between rotated rectangles

1. ## 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.

2. 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.

3. or use drawing api + blending modes + bitmap.draw + getColorBoundsRect per every scan line to estimate the area.

4. 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.

5. This is really a Calculus problem, more specifically a study called INTEGRATION.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap

Click Here to Expand Forum to Full Width