Sign in to follow this  
zitao

how determined they composed the coordinates of the area of all polygons?

Recommended Posts

But in 2D intersections (being points) don't have areas... at least, normally they don't...
This looks like a 2D question, though. And it's a nice drawing. Is it a puzzle?
Would you like to determine the number of intersections between the rectangles?

Are all other rectangles overlapping rectangle #1?
If you want to find the coords at the intersections of "overlapping" rectangles,
you could use a parametric test between a point and all rectangles that the point does not belong to, and contain the point.

If you're going for the total area, and you know that every bit of the outermost rectangle will be filled,
go with

(max(all_coords[o..n-1].x) - min(all_coords[o..n-1].x))
*
(max(all_coords[o..n-1].y) - min(all_coords[o..n-1].y))

This doesn't sum overlapping areas, of course.

Edited by SuperVGA

Share this post


Link to post
Share on other sites

But in 2D intersections (being points) don't have areas... at least, normally they don't...
This looks like a 2D question, though. And it's a nice drawing. Is it a puzzle?
Would you like to determine the number of intersections between the rectangles?

Are all other rectangles overlapping rectangle #1?
If you want to find the coords at the intersections of "overlapping" rectangles,
you could use a parametric test between a point and all rectangles that the point does not belong to, and contain the point.

If you're going for the total area, and you know that every bit of the outermost rectangle will be filled,
go with

(max(all_coords[o..n-1].x) - min(all_coords[o..n-1].x))
*
(max(all_coords[o..n-1].y) - min(all_coords[o..n-1].y))

This doesn't sum overlapping areas, of course.

thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this