Algorithm for Area of a closed polygon.

Sandeep Koranne skoranne at tanner.com
Wed Nov 12 14:55:17 PST 2003


Hi TEd,
Here is a simple method,
 
let us say the polygon is given by { (0,0), (10,0), (10,10), (0,10) }
Gven the array of [x,y] write then in 2 columns
 
X  Y
--------
0    0
10  0
10  10
0   10
0   0
 
do cross multiplication as you march down the column and sum the results on
left side and right side
eg
0*0 + 10*10+10*10+0*0 = 200 on left column
0*10+ 0*10 +10*0 + 10*0 = 0 on right column
subtract the left column from right column = 0 - 200 = -200
divide this by 2 to get area = -100 (if you want absolute area use abs)
 
HTH
sandeep
btw: this can be programmed in 4way SIMD on Intel and others to run
"extremely fast"
 
 
 
-----Original Message-----
From: Ted Hill [mailto:thill at tomotherapy.com]
Sent: Wednesday, November 12, 2003 7:00 AM
To: compgeom-discuss at research.bell-labs.com
Subject: Algorithm for Area of a closed polygon.


I want to be able to calculate the area inside a closed many-sided polygon.
 
Given an array of the (x,y) vertices that define the polygon, is there a
well-known algorithm that can calculate the enclosed area quickly?
 
Thanks,
 
Ted Hill
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://compgeom.poly.edu/pipermail/compgeom-announce/attachments/20031112/089870d4/attachment.htm


More information about the Compgeom-announce mailing list