|
-
Jan 22nd, 2004, 07:59 AM
#1
Area of Polygon... accurately
How do you calculate the area of an irregular polygon? The algorithm should work for any concievable 2D polygon, irregular or not.
I can't find any code on google.
Thanks.
I don't live here any more.
-
Jan 22nd, 2004, 11:27 AM
#2
I was just looking at planimeters and how they work on the web. I don't know an equation for finding the area of any polygon, and wasn't really thinking of doing such a thing, but one possibility would be to look at how planimeters work, and create your own function. Another would be to come up with a technique to chop your polygon into triangles. Once you have that, you can add the areas of the triangles.
-
Jan 22nd, 2004, 11:36 AM
#3
Hmm, Planimeters were a real mind-f*** when I first saw one.
How the hell does a wheel on a stick find the area of anything? 
Anyway, I have though of using a monte-carlo method but that would take too long to generate enough random numbers.
The triangles plan would cause stack problems with very complex polygons. I'm looking at more than 10000 sides here 
Any more ideas anyone?
I don't live here any more.
-
Jan 22nd, 2004, 09:56 PM
#4
Not if you just put it in a loop instead of in a function. I'd bet the triangle would actually be the best option.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Jan 23rd, 2004, 04:15 AM
#5
OK. but what triangles would I try to calculate?
Where for example would they be on this polygon...

?
I don't live here any more.
-
Jan 23rd, 2004, 05:18 AM
#6
-
Jan 23rd, 2004, 09:46 AM
#7
OK, that's pretty neat.
But what about self-intersecting polygons? Do you reckon that algorithm could be adapted to work on them too?
I don't live here any more.
-
Jan 23rd, 2004, 10:16 AM
#8
what do you mean by self-intersecting? the lines crossing each other?
-
Jan 23rd, 2004, 11:22 AM
#9
Originally posted by wossname
OK, that's pretty neat.
But what about self-intersecting polygons? Do you reckon that algorithm could be adapted to work on them too?
A self-intersected polygon can be just regarded as a number of non-intersected polygons.
-
Jan 23rd, 2004, 11:51 AM
#10
I haven't used this for polygons with thousands of sides so I don't know if it might be too slow for you. Maybe it's worth a try.
http://www.vbforums.com/showthread.p...hreadid=233516
-
Jan 23rd, 2004, 03:53 PM
#11
Thanks, I'll try it on Monday.
I don't live here any more.
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
|