# Tangent to ellipse at point

I am searching for a tangent (or just it's angle) to an ellipse at a specific point on the ellipse (or it's angle to the center of the ellipse).

The equation of the ellipse is $$\frac{x^2}{\text{a}^2} + \frac{y^2}{\text{b}^2} = 1$$.

a, b, $$a$$ and the point of the intersection are given and I search for $$b$$, the angle of the tangent.

I tried a geometic approach which results a almost accurate angle. I just take a line at two points, one degree left and right to 𝑎 and recieve the angle 𝑏 by using the arc tan of the points.

Is there a more accurate way?

The slope of the tangent to the ellipse at a point is just the derivative. Using implicit differentiation we get that $$\frac{2x}{a^2} + \frac{2y}{b^2} \frac{\mathrm{d}y}{\mathrm{d}x} = 0 \implies\frac{\mathrm{d}y}{\mathrm{d}x} = -\frac{xb^2}{ya^2}$$ And recalling the point-slope formula for a line, if $$(x_0, y_0)$$ is some point on the ellipse, then the tangent line at that point is $$y = -\frac{x_0b^2}{y_0a^2}(x-x_0) + y_0$$
$$\frac{x^2}{\text{a}^2} + \frac{y^2}{\text{b}^2} = 1$$ $$\frac{2x}{a^2} + \frac{2yy'}{b^2} = 0$$ $$\frac{2b^2x + 2a^2yy'}{a^2b^2} = 0$$ $$2b^2x + 2a^2yy' = 0$$ $$2a^2yy' = -2b^2x$$ $$y' = \frac{-2b^2x}{2a^2y}$$ $$y' = \frac{-b^2x}{a^2y}$$
That gives you the slope of the tangent line at the point $$(x, y)$$.