Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.