To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > General Help > Math and Physics

Reply
 
Thread Tools Search this Thread Display Modes
Old 09-16-2009, 11:35 AM   #1
bluekronos
Senior Member
 
Join Date: Jan 2003
Location: Austin, TX
Posts: 293
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.
bluekronos is offline   Reply With Quote
Old 09-17-2009, 08:02 PM   #2
rachil0
Senior Member
 
rachil0's Avatar
 
Join Date: Jul 2007
Location: Columbus, OH.
Posts: 461
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.
rachil0 is offline   Reply With Quote
Old 10-07-2009, 04:54 AM   #3
realMakc
Senior Member
 
Join Date: Oct 2002
Posts: 444
or use drawing api + blending modes + bitmap.draw + getColorBoundsRect per every scan line to estimate the area.
__________________
My flash stuff
realMakc is offline   Reply With Quote
Old 12-26-2009, 05:42 PM   #4
ZippyDee
Senior Member
 
Join Date: Dec 2004
Posts: 453
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.
__________________
Z¡µµ¥ D££

Soup In A Box
ZippyDee is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > General Help > Math and Physics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:17 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.