Path: news.mathworks.com!not-for-mail
From: "Naresh Pai" <npai@uark.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Calculate area of polygon area with holes
Date: Thu, 30 Jul 2009 20:33:19 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <h4t02f$ijh$1@fred.mathworks.com>
References: <h0oll9$r0s$1@fred.mathworks.com> <h0ouvg$gja$1@fred.mathworks.com> <h0p79m$21s$1@fred.mathworks.com>
Reply-To: "Naresh Pai" <npai@uark.edu>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1248985999 19057 172.30.248.35 (30 Jul 2009 20:33:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 30 Jul 2009 20:33:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1663676
Xref: news.mathworks.com comp.soft-sys.matlab:559758


Hi Bruno,
      I was reading one of your posts on mathworks. I have a similar issue where I would like to calculate the area of a polygon which as holes in it. The polyarea function seems to count this area too. Is there a work around ?

Naresh

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h0p79m$21s$1@fred.mathworks.com>...
> "Lucas " <l.antispamchars.wilkins@sussex.moreantispam.ac.unitedkingdomdomainname> wrote in message <h0ouvg$gja$1@fred.mathworks.com>...
> > Polyarea will help speed up the coding (not the code though) - just make sure every area you use is convex
> 
> Polyarea does not require for convexity. It should work for simply connected (read no hole) polygon with arbitrary shape. There is no need for fancy triangulation either. The formula is based on algebric areas of all triangles formed by two vertices and origin. When one sum all that areas, it remains the intrinsic area of the polygon.
> 
> Bruno