Find tangent lines of a rotated ellipse through certain point

geometry

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

Best Answer

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

$$A(x-x_D)^2+B(x-x_D)(y-y_D)+C(y-y_D)^2+D(x-x_D)+E(y-y_D)+F=0$$

and you can compute the new coefficients.

Now assume that the equation of the tangent is

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

$$(cm^2+bm+a)x^2+(em+d)x+f=0.$$

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

$$(em+d)^2-4f(cm^2+bm+a)=0.$$

This gives us the solutions

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