Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Intersection between line and half-circle
Date: Sun, 8 Nov 2009 05:37:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <hd5ldt$p8g$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1257658621 25872 172.30.248.37 (8 Nov 2009 05:37:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 8 Nov 2009 05:37:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2082095
Xref: news.mathworks.com comp.soft-sys.matlab:583293


How do I find the intersections between a line and a circle? If I do it by hand, I end up with:

y = mx +b (line equation)
(x-h)^2 + (y- k)^2 = r^2   (circle equation)

do some algebra...

(x-h)^2 + (mx + b - k )^2 = r^2

(x-h)^2 = r^2 - (mx +b -k)^2

How do I make Matlab get x for me?