Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!decwrl!sgi!davis@bedlam.esd.sgi.com From: davis@bedlam.esd.sgi.com (Tom Davis) Newsgroups: comp.sys.sgi Subject: Re: Area of a Polygon Summary: Formula for polygonal area Keywords: area,polygon,arbitrary,overlay Message-ID: <83906@sgi.sgi.com> Date: 4 Feb 91 16:01:34 GMT References: Sender: guest@sgi.sgi.com Distribution: usa Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 19 There's a simple formula to find the (signed) area of a polygon. The sign will be positive or negative depending on whether the points describe a counter-clockwise or clockwise polygon, respectively. Assume the polygon has n points: (x[0], y[0]), (x[1], y[1]), ... (x[n-1], y[n-1]). For notational convenience, define x[n] = x[0] and y[n] = y[0]. Then the area is given by: n-1 __ A = \ (x[i]*(y[i+1] - y[i]) - y[i]*(x[i+1] - x[i]))/2 /__ i = 0 I hope this helps. If you can't remember the formula (I usually can't), it's just a trivial application of Stokes Theorem, where the surface is just the x-y plane.