Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!k2g2000hse.googlegroups.com!not-for-mail
From: glaroc <glaroc@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Intersect circle and irregular shape
Date: Wed, 9 Jan 2008 11:05:41 -0800 (PST)
Organization: http://groups.google.com
Lines: 29
Message-ID: <1c0f9a46-130e-4bd6-9918-8238171a5977@k2g2000hse.googlegroups.com>
References: <66c9ae27-c839-41e2-a9a3-d5dcc7f311a7@i12g2000prf.googlegroups.com> 
NNTP-Posting-Host: 142.157.84.29
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1199905542 27608 127.0.0.1 (9 Jan 2008 19:05:42 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 9 Jan 2008 19:05:42 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: k2g2000hse.googlegroups.com; posting-host=142.157.84.29; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-CA; rv:1.8.1.11) 
Xref: news.mathworks.com comp.soft-sys.matlab:445085


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