pro anomaly, e, ma, ea, dea ; ; Given the orbital eccentricity e and mean anomaly ma (in radians) ; of an orbiting body, this procedure solves Kepler's equation for the ; eccentric anomaly ea (in radians). ; ; B. Knapp, 1998.12.14 ; ; RCS Data ; ; $Header: /home/betelgeuse/knapp/idllib/RCS/anomaly.pro,v 1.1 1999/12/02 21:11:40 knapp Exp $ ; ; $Log: anomaly.pro,v $ ; Revision 1.1 1999/12/02 21:11:40 knapp ; Initial revision ; ; Initial estimate (from Lawrence G. Taff, Celestial Mechanics, 1985) m = ma mod (2.d0*!dpi) ea = m+e*sin(m)/(1.d0+sin(m)-sin(m+e)) ; ; Newton-Raphson iteration kmax = 100 k = 0 ; print, k, ea*!radeg repeat begin dea = (ea-e*sin(ea)-m)/(1.0d0-e*cos(ea)) ea = ea-dea k = k+1 ; print, k, ea*!radeg endrep until abs(dea) lt 1.0d-14 or k ge kmax ; return end