# The tangent to an ellipse from polar coordinates

I have an ellipse. Quite simple, ecc=0.60. And I'm doodling with calculus I learned 40 years ago.

I can find the tangent to the ellipse, that is, the slope of the tangent, using cartestian coordinates. At the point where the tangent skims the top of the minor axis (b) the slope is 0 and and at the semi-latus rectum slope = ecc, that is the way it should be.

Now I take the ellipse in polar coordinates around the right hand focus :

r = a*(1 - ecc**2)/(1 + ecc*cos(Theta))

to find the slope I differentiate and have :

dr/dTheta = a*ecc*(1 - ecc**2)*(sin(Theta)) / ((1 + ecc*cos(Theta))**2)

then I divide by r to get the slope of the tangent.

I am doing something wrong here because my two methods only agree at the ends of the major axis and the semi-latus rectum. At r = a, where the point is above the minor axis it has a non-zero slope.

What am I doing wrong?

## Answers and Replies

Got it!

dy/dx is the slope, not dr/r*dTheta,

slope is (ecc*sin(Theta)**2/(1+Ecc*cos(Theta)) + cos(Theta)) /
(ecc*sin(Theta)*cos(Theta)/(1+Ecc*cos(Theta)) - sin(Theta))