|
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.
|