Path: news.mathworks.com!not-for-mail
From: "Charles Cuell" <cuell@math.usask.ca>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Intersect circle and irregular shape
Date: Wed, 9 Jan 2008 18:32:01 +0000 (UTC)
Organization: Environment Canada
Lines: 35
Message-ID: <fm33v1$hkn$1@fred.mathworks.com>
References: <66c9ae27-c839-41e2-a9a3-d5dcc7f311a7@i12g2000prf.googlegroups.com>
Reply-To: "Charles Cuell" <cuell@math.usask.ca>
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 1199903521 18071 172.30.248.35 (9 Jan 2008 18:32:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 9 Jan 2008 18:32:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 811838
Xref: news.mathworks.com comp.soft-sys.matlab:445078


glaroc <glaroc@gmail.com> wrote in message <66c9ae27-c839-
41e2-a9a3-d5dcc7f311a7@i12g2000prf.googlegroups.com>...
> Hi, I am looking for ways to calculate the percentage of 
the
> circumference of a circle enclosed within an intersecting 
irregular
> polygon. For example, if I have a circle centered within 
a triangle, I
> want to know how much of the circumference of the circle 
is contained
> within the triangle. This could be anywhere between 0 and 
100. I know
> I can do this in a topological GIS, but I really need 
Matlab for this.
> I want to use this to build an edge correction program. I 
couldn't
> find anything in the Matlab file central or anywhere else.
> 
> Thank you for any help you may provide,
> 
> GL

GL,

I would take 100 or 1000 or 10 000 or 10^k evenly spaced 
points on the circle and calculate the percentage that lie 
inside the figure. If the figure is quite irregular, then 
perhaps choosing 10^k randomly distibuted points and 
running the code many times would be best.

This is only an approximation, of course, but it should be 
easy to code, fast and give good results.

Charles