Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Please Help, How to calculate the area percentage of each color in a contour map?
Date: Wed, 10 Jun 2009 21:07:02 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 6
Message-ID: <h0p79m$21s$1@fred.mathworks.com>
References: <h0oll9$r0s$1@fred.mathworks.com> <h0ouvg$gja$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
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 1244668022 2108 172.30.248.35 (10 Jun 2009 21:07:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 10 Jun 2009 21:07:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:546350


"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