Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!postnews.google.com!d5g2000yqm.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Intersection between line and half-circle
Date: Sun, 8 Nov 2009 00:34:42 -0800 (PST)
Organization: http://groups.google.com
Lines: 23
Message-ID: <0727aeb3-86d2-42f3-b629-4fb12f55a557@d5g2000yqm.googlegroups.com>
References: <hd5ldt$p8g$1@fred.mathworks.com>
NNTP-Posting-Host: 77.17.8.48
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1257669283 9527 127.0.0.1 (8 Nov 2009 08:34:43 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 8 Nov 2009 08:34:43 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: d5g2000yqm.googlegroups.com; posting-host=77.17.8.48; 
	posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; 
	Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; 
	.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:583300


On 8 Nov, 06:37, "Catherine Szeto" <catsz...@gmail.com> wrote:
> 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?

1) Write out the expression as a 2nd order polynomial in x
2) Write out the standard formula for solving 2nd order
   polynomials
3) Find the numbers that go into the formulas
4) Have matlab compute the answers from the formulas and
   numbers

Rune