Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!uakari.primate.wisc.edu!xanth!mcnc!thorin!matisse!airey From: airey@matisse.cs.unc.edu (John Airey) Newsgroups: comp.graphics Subject: Re: Need an algorithm to calculate area of polygons Keywords: Polygon, algorithm Message-ID: <9885@thorin.cs.unc.edu> Date: 9 Oct 89 15:03:09 GMT References: <484@ctycal.UUCP> <619@cditi.UUCP> <2273@uw-entropy.ms.washington.edu> Sender: news@thorin.cs.unc.edu Reply-To: airey@matisse.cs.unc.edu (John Airey) Organization: University Of North Carolina, Chapel Hill Lines: 19 In article <2273@uw-entropy.ms.washington.edu> bill@stuart.UUCP () writes: >>In article <484@ctycal.UUCP>, ingoldsb@ctycal.COM (Terry Ingoldsby) writes: >># I need an algorithm that will calculate (quickly) >># the area of an arbitrary polygon. ^^^^^^^^^ If arbitrary means possibly concave, the following suggestion is inadequate. >1/2 * sum( x(i)*y(i-1) - y(i)*x(i-1) ), wrapping the indexes around the ends >will give the (signed) area of a polygon. The sign is positive if the >vertices are given clockwise. Each summand is the signed area of a triangle >with one edge an edge of the polygon and the remaining vertex (0,0). > Bill Dunlap john m. airey airey@cs.unc.edu