Path: news.mathworks.com!not-for-mail
From: "Joaquim Luis" <jluis@--ualg--.pt>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Intersect circle and irregular shape
Date: Wed, 9 Jan 2008 23:16:02 +0000 (UTC)
Organization: Univ do Algarve
Lines: 39
Message-ID: <fm3kji$2qt$1@fred.mathworks.com>
References: <66c9ae27-c839-41e2-a9a3-d5dcc7f311a7@i12g2000prf.googlegroups.com> <fm3cmg$r8q$1@fred.mathworks.com> <fm3igl$kmn$1@fred.mathworks.com>
Reply-To: "Joaquim Luis" <jluis@--ualg--.pt>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1199920562 2909 172.30.248.38 (9 Jan 2008 23:16:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 9 Jan 2008 23:16:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 594262
Xref: news.mathworks.com comp.soft-sys.matlab:445123


"Roger 
Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote 
in message <fm3igl$kmn$1@fred.mathworks.com>...

> -----------
>   Joaquim, if I interpret Guillaume Jacquenot's m-file 
for the 
> "Polygons_intersection" function on the Matlab Central 
File Exchange 
> correctly, he has to approximate curved shapes like 
circles with discrete 
> polygons.  His example has the following two lines:
> 
>  S(1).P(1).x = [1.5 1.5 0.5 1.5+cos(pi:pi/30:3*pi/2)];
>  S(1).P(1).y = [0.5 1.5 1.5 1.5+sin(pi:pi/30:3*pi/2)];
> 
> which would contain a quarter circle as approximated by 
16 polygonal 
> segments.
> 
>   The problem of finding the intersection between a line 
segment and a circle 
> is very straightforward and just involves the solution to 
a simple quadratic 
> equation, so I don't see why GL can't do it that way 
directly, rather than mess 
> around with such approximations.

Roger,
Yes, that's right but in his first message he mentioned

"I am looking for ways to calculate the percentage of the 
circumference of a circle enclosed within an intersecting 
irregular polygon."

So I guess that the clipping polygons solution is, at 
least, easier to use.

Joaquim Luis