At 09:32 AM 4/24/02 +1000, Robert Crossley wrote:
>A while ago, I asked a question about an external function to calculate
>the area of a polygon and got some good references. I ended up using the
>gauss-green function based on the formula:
>Area=(Sum(y(n)-y(n+1))*(x(n)+x(n+1)))/2 .
>...
>So am I correct in assuming that the area is the positive value of the
>calculated area from the gauss-green formula and forget about trying to
>work out the direction
Yes. Actually, the formula above is the negative of the usual formula. It
is recognizable as a discrete version of the line integral
Integral {around perimeter} ( -x * dy )
which, by Green's Theorem, is equal to
Integral {over entire region} (-1 * dx * dy)
which is the definition of SIGNED area, but negated. That area will be
negative for a positively-oriented region (counterclockwise polygon) and
positive for a negatively-oriented region. Taking the absolute value is
fine provided you have a simple polygon (no self intersections, one
connected component). If you have a polygon with holes, add all the terms
before you take the absolute value. For an illustration of what's going
on, please refer to
http://www.quantdec.com/SYSEN597/GTKAV/section2/chapter_11.htm .
--Bill Huber
www.quantdec.com
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]