Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: solve equation
Date: Fri, 5 Dec 2008 00:48:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <gh9to2$lq4$1@fred.mathworks.com>
References: <gh9pu6$7ug$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1228438082 22340 172.30.248.35 (5 Dec 2008 00:48:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 5 Dec 2008 00:48:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:505089


"Song Joo " <song-lee@northwestern.edu> wrote in message <gh9pu6$7ug$1@fred.mathworks.com>...
> Hi all,
> How could I solve these equations in matlab?
> 
> a^2-(x3-x2)^2-(y3-y2)^2=0
> b^2-(x2-x1)^2-(y2-y1)^2=0
> 
> a, b, x1,x3,y1, y3 are known. so basically i am looking for x2 and y2.
> solve command does not solve these equations. Does anybody know how to simply do this?
> 
> Thanks in advance.

  I would have thought 'solve' could do that problem easily.  Did you specify which were to be regarded as the unknowns in your call to it?

  It is also easy to solve it manually.  Just subtract one equation from the other, thereby eliminating the x2^2 and y2^2 terms, and leaving an expression that is linear in x2 and y2.  You can then solve for one of these in terms of the other.  Substituting it in one of the original equations will give a quadratic equation in a single unknown.  You will in general find two solutions for it.  Then use the above linear expression to find the other unknown.

Roger Stafford