Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!ginosko!uunet!munnari.oz.au!mimir!hugin!augean!sirius!nt!levels!marwk From: MARWK@levels.sait.edu.au Newsgroups: comp.graphics Subject: Re: Need an algorithm to calculate area of polygons Message-ID: <2060@levels.sait.edu.au> Date: 10 Oct 89 17:17:48 GMT References: <484@ctycal.UUCP> Organization: Sth Australian Inst of Technology Lines: 32 In article , allan@didsgn.uucp (didsgn) writes: > ingoldsb@ctycal.COM (Terry Ingoldsby) writes: > >>This is probably a trivial problem, and one that has been much >>discussed, but I need an algorithm that will calculate (quickly) >>the area of an arbitrary polygon. It would be *nice* if it could >>handle objects that include arcs, instead of lines for the edges of >>the `polygon'. I have to be able to handle complicated cases like > >> *--------------------------* >> | *________________| >> | | >> | *_______* >> | / >> *_____* / >> / / It's hard to draw diagonal lines! >> */------* > >>Sorry if this is trivial or has been discussed ad nauseum before. > > If this is an image that has been stored in "pixel"-type memory, and not > just a list of coordinates (i.e. given an arbitrary shape, determine > the area of the shape), then I have a very simple approach that works > fairly quickly (it depends on the length of the outside perimeter). As > a side benifit, the perimeter of the object and knowledge as to > whether it is a hole or an object is also given. If you're interested, > I forward the details to anyone interested. > Please post it. Ray