I am trying to obtain the two tangent lines to an ellipse passing through a certain point. I found some similar questions but none that I could find used the ellipse equation $Ax^2 + Bxy + Cy^2 + Dx + Ey + F$.

Looking at the below example, I want to obtain the two points E and F where the ellipse and the point D are known. How am I able to calculate those tangent lines (or points) for a rotated ellipse?

enter image description here


Translate the plane so that $D$ comes to the origin. The conic equation becomes


and you can compute the new coefficients.

Now assume that the equation of the tangent is

$$y=mx$$ and you get the condition


We have tangency when this equation has a double root, i.e.


This gives us the solutions

$$m=\frac{\pm\sqrt{(e^2-4cf) (4af-d^2)+(de-2 bf)^2}+2bf-de}{e^2-4cf}.$$

  • $\begingroup$ Ended up using this. Thanks! $\endgroup$ – Stan Jul 9 at 9:20
  • $\begingroup$ @Stan: glad to know. Not my favorite approach though, as it is not isotropic (and fails for vertical tangents). $\endgroup$ – Yves Daoust Jul 9 at 10:27
  1. Purely algebraic approach: from equation of ellipse $f(x,y)=0$ and equation of line $(y-y_0)=\alpha(x-x_0)$, you can get an quadratic equation: $$ \frac{y-y_0}{x-x_0}=-\frac{f'_x}{f'_y} $$ which is the equation of ellipse (which is the same as given one, but scaled and shifted). From this, you can find its intersection with the given ellipse.

  2. A better approach. You find canonical parameters of ellipse and thus the affine transformation to transform it to unit circle. You apply this transformation to point $D\to D'$ and find its tangent points $E'$ and $F'$ onto unit circle with simple geometry. Inverse transformation will give you points $E$ and $F$, since affine transformation doesn't change the tangency property.


Joachimsthal's Notations

  • $s_{ij}=Ax_i x_j+B\left( \dfrac{x_i y_j+x_j y_i}{2} \right)+C y_i y_j+D\left( \dfrac{x_i+x_j}{2} \right)+E\left( \dfrac{y_i+y_j}{2} \right)+F$

  • $s_{i}=Ax_i x+B\left( \dfrac{y_i x+x_i y}{2} \right)+C y_i y+D\left( \dfrac{x+x_i}{2} \right)+E\left( \dfrac{y+y_i}{2} \right)+F$

  • $s=Ax^2+Bxy+C y^2+Dx+Ey+F$

Tangent pairs through $P(x_1,y_1)$:

$$s_1^2=s_{11} s$$

See the proofs here and another answer of mine here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.