Solving Kepler's Equation of Elliptical Motion

back to Kepler's Applet

Details: series expansion, Newton's method
Movie of elliptical motion
Plots of elliptical Kepler motion
Circumgerence of an ellipse

E. Zinner: Astronomie, Alber, Freiburg/München 1951.

In 1609 Kepler published his work Astronomia Nova, containing the first (and the second) law of planetary motion:
Planets move in elliptical orbits with the sun at one focus.

Between 1617 and 1621 Kepler wrote Epitome Astronomiae Copernicanae, the first astronomy textbook based on the Copernican model. Kepler introduced what is now known as Kepler's equation for the solution of planetary orbits, using the eccentric anomaly E, and the mean anomaly M.

The term anomaly (instead of angle), which means irregularity, is used by astronomers describing planetary positions. The term originates from the fact that the observed locations of a planet often showed small deviations from the predicted data.

The mean anomaly M is the angular distance from perihelion which a (fictitious) planet would have if it moved on the circle of radius a with a constant angular velocity and with the same orbital period T as the real planet moving on the ellipse. By definition, M increases linearly (uniformly) with time.

Operating with radians Kepler's equation is:

E(t) - e*sin[E(t)] = M(t)

or, using degrees:

E(t) - (180°/π)*e*sin[E(t)] = M(t)

The equation can be derived from Kepler's second law.

The value of M at a given time is easily found when the eccentricity e and the eccentric anomaly E are known. The problem is to find E (from which the position of the planet can be computed) when M and e are known.
Kepler's equation cannot be solved algebraically.
It can be treated by an iteration methods. One of them is Newton's method, finding roots of

f(E) = E - e*sin(E) - M(t)

The true anomaly (symbol φ) is the angular distance of the planet from the perihelion of the planet, as seen from the Sun. For a circular orbit, the mean anomaly and the true anomaly are the same. The difference between the true anomaly and the mean anomaly is called the
Equation of Center C:

φ = M + C


JavaScript using Newton's method:

The form is preset to:

eccentricity e=0.5
mean anomaly M=27° or t/T=0.075.

The results, as shown in the figure below, are:

true anomaly phi=75.84°
eccentric anomaly E=48.43°

eccentricity e

mean anomaly M (in °)

decimal places (<15)

E = eccentric anomaly
phi = true anomaly




An example of a series expansion is:

Details: series expansion, Newton's method
Movie of elliptical motion
Plots of elliptical Kepler motion
Circumference of an ellipse

For small eccentricities the mean anomaly M can be used as an initial value E0 for the iteration. In case of e>0.8 the initial value E0=π is taken.

function EccAnom(ec,m,dp) {

// arguments:
// ec=eccentricity, m=mean anomaly,
// dp=number of decimal places

var pi=Math.PI, K=pi/180.0;

var maxIter=30, i=0;

var delta=Math.pow(10,-dp);

var E, F;



if (ec<0.8) E=m; else E=pi;

F = E - ec*Math.sin(m) - m;

while ((Math.abs(F)>delta) && (i<maxIter)) {

E = E - F/(1.0-ec*Math.cos(E));

F = E - ec*Math.sin(E) - m;

i = i + 1;



return Math.round(E*Math.pow(10,dp))/Math.pow(10,dp);


function TrueAnom(ec,E,dp) {






return Math.round(phi*Math.pow(10,dp))/Math.pow(10,dp);



function position(a, ec,E) {

// a=semimajor axis, ec=eccentricity, E=eccentric anomaly

// x,y = coordinates of the planet with respect to the Sun

C = Math.cos(E);

S = Math.sin(E);

x = a*(C-ec);

y = a*Math.sqrt(1.0-ec*ec)*S;


Web Links

Celestial Mechanics

Astronomy Answers - Position of the Sun

Kepler, Napier, and the Third Law

Kepler's Equation (Wikipedia)

Kepler's Equation for Elliptical Motion, a Numerical Solution Utility

Solution of Kepler's equation by Newton-Raphson Method

Peter Colwell: Solving Kepler's Equation Over Three Centuries,
Willmann-Bell, Richmond VA, 1993.

Jean Meeus: Astronomical Algorithms, Chapter 29: Equation of Kepler (pp 181-196), Willmann-Bell, Richmond VA.

back to Kepler's Applet

(c) 2006-2016 J. Giesen

Updated: 2016, Jan 05