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 19:22:02 +0000 (UTC)
Organization: Environment Canada
Lines: 47
Message-ID: <fm36sq$2m2$1@fred.mathworks.com>
References: <66c9ae27-c839-41e2-a9a3-d5dcc7f311a7@i12g2000prf.googlegroups.com>  <1c0f9a46-130e-4bd6-9918-8238171a5977@k2g2000hse.googlegroups.com>
Reply-To: "Charles Cuell" <cuell@math.usask.ca>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1199906522 2754 172.30.248.37 (9 Jan 2008 19:22:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 9 Jan 2008 19:22:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 811838
Xref: news.mathworks.com comp.soft-sys.matlab:445087


glaroc <glaroc@gmail.com> wrote in message <1c0f9a46-130e-
4bd6-9918-8238171a5977@k2g2000hse.googlegroups.com>...
> In fact, I already tried this approximation method. The 
problem is
> that it is quite slow since I have to do this for 
thousands of circle.
> This involves a lot of inpolygon calculations. Roger's 
method seems
> longer to code, but will likely be a lot faster.
> 
> I will give it a try when I have a minute.
> 
> GL
> >
> > $...@fred.mathworks.com>...> 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
> >
> > -------
> >   Charles, I grant you this would be easier to code, 
but if the 10^k value
> > Glaroc choses to select is very large so as to be 
accurate, this would mean
> > that same number of calls on inpolygon.  It might not 
execute as fast as he
> > would like, as compared with only one call per arc 
midpoint using the
> > intersection method.
> >
> > Roger Stafford
> 

I would just go for coffee, or lunch, or a vacation :)
Point taken, anyway.

Charles