Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Intersection between line and half-circle
Date: Mon, 9 Nov 2009 02:58:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 25
Message-ID: <hd80fp$nfr$1@fred.mathworks.com>
References: <hd5ldt$p8g$1@fred.mathworks.com> <0727aeb3-86d2-42f3-b629-4fb12f55a557@d5g2000yqm.googlegroups.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 1257735481 24059 172.30.248.37 (9 Nov 2009 02:58:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Nov 2009 02:58:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2082095
Xref: news.mathworks.com comp.soft-sys.matlab:583458


Rune Allnor <allnor@tele.ntnu.no> wrote in message <0727aeb3-86d2-42f3-b629-4fb12f55a557@d5g2000yqm.googlegroups.com>...
> 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

Thanks, I got it working. Turns out I was using a function wrong.