# algorithm for the intersections of a line and an ellipse in 2D

I am looking for an algorithm for finding the intersection of a line and an ellipse.

I have the line in the form

$ax+by+c=0 \qquad(1)$

and the ellipse in the form

$Ax^2+Bxy+Cy^2+Dx+Ey+F=0 \qquad(2)$

My idea is to solve in a closed form the system $(1),(2)$. Is it too naive? What are the pitfalls of such approach?

-
Not naive. Use (1) to eliminate a variable in (2), then apply the quadratic formula. –  hardmath Jun 7 '11 at 13:52
One potential pitfall is that your equation for an ellipse includes parabolas and hyperbolas. So if you really want an ellipse, start with a more specific equation. I would rotate and translate so the ellipse is $x^2/A^2 + y^2/B^2 =1$. –  Joseph O'Rourke Jun 7 '11 at 13:53
@Joseph Good idea: you might as well follow that up with another affine transformation sending the ellipse to the unit circle and then rotate the whole picture to make the line vertical, making the computation obvious (and trivial). In fact, if you're willing to apply projective transformations, the same approach solves the problem for any conic section, not just ellipses. –  whuber Jun 7 '11 at 15:38
@whuber: Good point! –  Joseph O'Rourke Jun 7 '11 at 17:15