The slope of tangent line to a rotated ellipse at a specific point

conic sectionsslopetangent line

I've seen discussions about this but with too many details left out. I have an ellipse with the standard parameters: $h, k, a, b$ and a rotation angle. (I can convert all that to the general form coefficients: $A, B, C, D, E,$ and $F$ if needed)

To get the tangent line, I check to see if the slope equals infinity or not and do some very simple math (no trig) to generate a couple of points, thus defining a line.

But getting the slope is proving to be problematic. I check to see if either the x or y of the given point are at any extrema (pre-calculated) and set the slope to $0$ or infinity, accordingly. But I can't seem to work out the math for the "normal" cases.

I can use $$-(\frac{x}{ y} \cdot \frac{b^2}{a^2})$$ for a non-rotated ellipse. But this doesn't work, of course, in the rotated case.

Best Answer

When the ellipse is rotated, the tangent is rotated as well. From the slope on the non-rotated ellipse ($=\tan{\varphi}$), you can calculate the angle $\varphi$, add the rotation angle $\rho$ and calculate the tangent of the sum to get the desired slope: $$\tan{(\varphi + \rho)} = \frac{\tan{\varphi}+\tan{\rho}}{1-\tan{\varphi}\tan{\rho}}$$