A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: area of intersection between rotated rectangles

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Austin, TX

    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. #2
    Senior Member rachil0's Avatar
    Join Date
    Jul 2007
    Columbus, OH.
    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. #3
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    or use drawing api + blending modes + bitmap.draw + getColorBoundsRect per every scan line to estimate the area.
    who is this? a word of friendly advice: FFS stop using AS2

  4. #4
    var x:Number = 1; x /= 0;
    Join Date
    Dec 2004
    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. #5
    Join Date
    Feb 2010
    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

Click Here to Expand Forum to Full Width

HTML5 Development Center