-
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.
-
Senior Member
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.
-
Senior Member
or use drawing api + blending modes + bitmap.draw + getColorBoundsRect per every scan line to estimate the area.
-
var x:Number = 1; x /= 0;
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.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|