Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: circle intersection help
Date: Thu, 26 Feb 2009 13:12:01 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 32
Message-ID: <go64f1$95b$1@fred.mathworks.com>
References: <go5moa$2e2$1@fred.mathworks.com> <go60fh$d9g$1@fred.mathworks.com> <go61sh$gnh$1@fred.mathworks.com> <go6369$do2$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
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 1235653921 9387 172.30.248.38 (26 Feb 2009 13:12:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 26 Feb 2009 13:12:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:521004

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <go6369$do2$1@fred.mathworks.com>...

> Ok, if the radii are known, then just do this. We
> know the equations of each circle.
> 
> (x - x1)^2 + (y-y1)^2 = R1^2
> (x - x2)^2 + (y-y2)^2 = R2^2
> (x - x3)^2 + (y-y3)^2 = R3^2
> (x - x4)^2 + (y-y4)^2 = R4^2
> 
> Subtract one from the rest. Thus
> 
> 2*(x2 - x1)*x + 2*(y2 - y1)*y = R2^2 - R1^2 + x1^2 - x2^2
> 2*(x3 - x1)*x + 2*(y3 - y1)*y = R3^2 - R1^2 + x1^2 - x3^2
> 2*(x4 - x1)*x + 2*(y4 - y1)*y = R4^2 - R1^2 + x1^2 - x4^2
> 
> This is a linear system of 3 equations in the two
> unknowns (x,y). Solve using backslash.
> 
> A = 2*[(x2 - x1),(y2 - y1);(x3 - x1),(y3 - y1);(x4 - x1),(y4 - y1)]; 
> rhs = [R2^2 - R1^2 + x1^2 - x2^2; ...
>          R3^2 - R1^2 + x1^2 - x3^2; ...
>          R4^2 - R1^2 + x1^2 - x4^2];

Sorry. I left out one part of this, obviously
as an exercise for the student.

rhs = [R2^2 - R1^2 + x1^2 - x2^2 + y1^2 - y2^2; ...
         R3^2 - R1^2 + x1^2 - x3^2 + y1^2 - y3^2; ...
         R4^2 - R1^2 + x1^2 - x4^2 + y1^2 - y4^2];

John