# Kepler's laws of planetary motion

In astronomy, Kepler's laws of planetary motion, published by Johannes Kepler in 1609 (except the third law, which was fully published in 1619), describe the orbits of planets around the Sun. These laws replaced circular orbits and epicycles in the heliocentric theory of Nicolaus Copernicus with elliptical orbits and explained how planetary velocities vary. The three laws state that:
* The orbit of a planet is an ellipse with the Sun at one of the two foci.
* A line segment joining a planet and the Sun sweeps out equal areas during equal intervals of time.
* The square of a planet's orbital period is proportional to the cube of the length of the semi-major axis of its orbit.
The elliptical orbits of planets were indicated by calculations of the orbit of Mars. From this, Kepler inferred that other bodies in the Solar System, including those farther away from the Sun, also have elliptical orbits. The second law establishes that when a planet is closer to the Sun, it travels faster. The third law expresses that the farther a planet is from the Sun, the longer its orbital period.
Isaac Newton showed in 1687 that relationships like Kepler's would apply in the Solar System as a consequence of his own laws of motion and law of universal gravitation.
A more precise historical approach is found in Astronomia nova and Epitome Astronomiae Copernicanae.

## Comparison to Copernicus

Johannes Kepler's laws improved the model of Copernicus. According to Copernicus:
* The planetary orbit is a circle with epicycles.
* The Sun is approximately at the center of the orbit.
* The speed of the planet in the main orbit is constant.
Despite being correct in saying that the planets revolved around the Sun, Copernicus was incorrect in defining their orbits. Introducing physical explanations for movement in space beyond just geometry, Kepler correctly defined the orbit of planets as follows:$^{:53–54}$
* The planetary orbit is not a circle with epicycles, but an ellipse.
* The Sun is not at the center but at a focal point of the elliptical orbit.
* Neither the linear speed nor the angular speed of the planet in the orbit is constant, but the area speed (closely linked historically with the concept of angular momentum) is constant.
The eccentricity of the orbit of the Earth makes the time from the March equinox to the September equinox, around 186 days, unequal to the time from the September equinox to the March equinox, around 179 days. A diameter would cut the orbit into equal parts, but the plane through the Sun parallel to the equator of the Earth cuts the orbit into two parts with areas in a 186 to 179 ratio, so the eccentricity of the orbit of the Earth is approximately
    $e\approx {\frac {\pi }{4}}{\frac {186-179}{186+179}}\approx 0.015,$
which is close to the correct value (0.016710218). The accuracy of this calculation requires that the two dates chosen be along the elliptical orbit's minor axis and that the midpoints of each half be along the major axis. As the two dates chosen here are equinoxes, this will be correct when perihelion, the date the Earth is closest to the Sun, falls on a solstice. The current perihelion, near January 4, is fairly close to the solstice of December 21 or 22.

## Nomenclature

It took nearly two centuries for the current formulation of Kepler's work to take on its settled form. Voltaire's Eléments de la philosophie de Newton (Elements of Newton's Philosophy) of 1738 was the first publication to use the terminology of "laws". The Biographical Encyclopedia of Astronomers in its article on Kepler (p. 620) states that the terminology of scientific laws for these discoveries was current at least from the time of Joseph de Lalande. It was the exposition of Robert Small, in An account of the astronomical discoveries of Kepler (1814) that made up the set of three laws, by adding in the third. Small also claimed, against the history, that these were empirical laws, based on inductive reasoning.
Further, the current usage of "Kepler's Second Law" is something of a misnomer. Kepler had two versions, related in a qualitative sense: the "distance law" and the "area law". The "area law" is what became the Second Law in the set of three; but Kepler did himself not privilege it in that way.

## History

Kepler published his first two laws about planetary motion in 1609, having found them by analyzing the astronomical observations of Tycho Brahe.$^{:53}$ Kepler's third law was published in 1619. Kepler had believed in the Copernican model of the Solar System, which called for circular orbits, but he could not reconcile Brahe's highly precise observations with a circular fit to Mars' orbit – Mars coincidentally having the highest eccentricity of all planets except Mercury. His first law reflected this discovery.
In 1621, Kepler noted that his third law applies to the four brightest moons of Jupiter. Godefroy Wendelin also made this observation in 1643. The second law, in the "area law" form, was contested by Nicolaus Mercator in a book from 1664, but by 1670 his Philosophical Transactions were in its favour. As the century proceeded it became more widely accepted. The reception in Germany changed noticeably between 1688, the year in which Newton's Principia was published and was taken to be basically Copernican, and 1690, by which time work of Gottfried Leibniz on Kepler had been published.
Newton was credited with understanding that the second law is not special to the inverse square law of gravitation, being a consequence just of the radial nature of that law, whereas the other laws do depend on the inverse square form of the attraction. Carl Runge and Wilhelm Lenz much later identified a symmetry principle in the phase space of planetary motion (the orthogonal group O(4) acting) which accounts for the first and third laws in the case of Newtonian gravitation, as conservation of angular momentum does via rotational symmetry for the second law.

## Formulary

The mathematical model of the kinematics of a planet subject to the laws allows a large range of further calculations.

### First law

Kepler's first law states that:
   The orbit of every planet is an ellipse with the sun at one of the two foci.
Mathematically, an ellipse can be represented by the formula:
    $r={\frac {p}{1+\varepsilon \,\cos \theta }},$
where $p$ is the semi-latus rectum, ε is the eccentricity of the ellipse, r is the distance from the Sun to the planet, and θ is the angle to the planet's current position from its closest approach, as seen from the Sun. So (r, θ) are polar coordinates.
For an ellipse 0 < ε < 1 ; in the limiting case ε = 0, the orbit is a circle with the Sun at the centre (i.e. where there is zero eccentricity).
At θ = 0°, perihelion, the distance is minimum
    $r_{\min }={\frac {p}{1+\varepsilon }}$
At θ = 90° and at θ = 270° the distance is equal to $p$.
At θ = 180°, aphelion, the distance is maximum (by definition, aphelion is – invariably – perihelion plus 180°)
    $r_{\max }={\frac {p}{1-\varepsilon }}$
The semi-major axis a is the arithmetic mean between r$_{min}$ and r$_{max}$:
    ${\begin{aligned}a&={\frac {r_{\max }+r_{\min }}{2}}\\[3pt]a&={\frac {p}{1-\varepsilon ^{2}}}\end{aligned}}$
The semi-minor axis b is the geometric mean between r$_{min}$ and r$_{max}$:
    ${\begin{aligned}b&={\sqrt {r_{\max }r_{\min }}}\\[3pt]b&={\frac {p}{\sqrt {1-\varepsilon ^{2}}}}\end{aligned}}$
The semi-latus rectum p is the harmonic mean between r$_{min}$ and r$_{max}$:
    ${\begin{aligned}p&=\left({\frac {r_{\max }^{-1}+r_{\min }^{-1}}{2}}\right)^{-1}\\pa&=r_{\max }r_{\min }=b^{2}\,\end{aligned}}$
The eccentricity ε is the coefficient of variation between r$_{min}$ and r$_{max}$:
    $\varepsilon ={\frac {r_{\max }-r_{\min }}{r_{\max }+r_{\min }}}.$
The area of the ellipse is
    $A=\pi ab\,.$
The special case of a circle is ε = 0, resulting in r = p = r$_{min}$ = r$_{max}$ = a = b and A = πr$^2$.

### Second law

Kepler's second law states that:
   A line joining a planet and the Sun sweeps out equal areas during equal intervals of time.
The orbital radius and angular velocity of the planet in the elliptical orbit will vary. This is shown in the animation: the planet travels faster when closer to the Sun, then slower when farther from the Sun. Kepler's second law states that the blue sector has constant area.

#### History and proofs

Kepler notably arrived at this law through assumptions that were either only approximately true or outright false and can be outlined as follows:
* Planets are pushed around the Sun by a force from the Sun. This false assumption relies on incorrect Aristotelian physics that an object needs to be pushed to maintain motion.
* The propelling force from the Sun is inversely proportional to the distance from the Sun. Kepler reasoned this, believing that gravity spreading in three dimensions would be a waste, since the planets inhabited a plane. Thus, an inverse instead of the [correct] inverse square law.
* Because Kepler believed that force would be proportional to velocity, it followed from statements #1 and #2 that velocity would be inverse to the distance from the sun. This is also an incorrect tenet of Aristotelian physics.
* Since velocity is inverse to time, the distance from the sun would be proportional to the time to cover a small piece of the orbit. This is approximately true for elliptical orbits.
* The area swept out is proportional to the overall time. This is also approximately true.
* The orbits of a planet are circular (Kepler discovered his Second Law before his First Law, which contradicts this).
Nevertheless, the result of the Second Law is exactly true, as it is logically equivalent to the conservation of angular momentum, which is true for any body experiencing a radially symmetric force. A correct proof can be shown through this. Since the cross product of two vectors gives the area of a parallelogram possessing sides of those vectors, the triangular area dA swept out in a short period of time is given by half the cross product of the r and dx vectors, for some short piece of the orbit, dx.
$dA={\frac {1}{2}}({\vec {r}}\times {\vec {dx}})={\frac {1}{2}}({\vec {r}}\times {\vec {v}}dt)$ for a small piece of the orbit dx and time to cover it dt.
Thus ${\frac {dA}{dt}}={\frac {1}{2}}({\vec {r}}\times {\vec {v}}).$
${\frac {dA}{dt}}={\frac {1}{m}}{\frac {1}{2}}({\vec {r}}\times {\vec {p}}).$
Since the final expression is proportional to the total angular momentum $({\vec {r}}\times {\vec {p}})$, Kepler's equal area law will hold for any system that conserves angular momentum. Since any radial force will produce no torque on the planet's motion, angular momentum will be conserved.

#### In terms of elliptical parameters

In a small time $dt$ the planet sweeps out a small triangle having base line $r$ and height $r\,d\theta$ and area dA=1/2 ⋅r⋅rdθ{\textstyle dA={\frac {1}{2}}\cdot r\cdot r\, d\theta }, so the constant areal velocity is ${\frac {dA}{dt}}={\frac {r^{2}}{2}}{\frac {d\theta }{dt}}.$
The area enclosed by the elliptical orbit is $\pi ab$. So the period $T$ satisfies
    $T\cdot {\frac {r^{2}}{2}}{\frac {d\theta }{dt}}=\pi ab$
and the mean motion of the planet around the Sun
    $n={\frac {2\pi }{T}}$
satisfies
    $r^{2}\,d\theta =abn\,dt.$
And so, ${\frac {dA}{dt}}={\frac {abn}{2}}={\frac {\pi ab}{T}}.$
Orbits of planets with varying eccentricities. :
| Low | High |
| Planet orbiting the Sun in a circular orbit (e=0.0) | Planet orbiting the Sun in an orbit with e=0.5 |
| Planet orbiting the Sun in an orbit with e=0.2 | Planet orbiting the Sun in an orbit with e=0.8 |
| The red ray rotates at a constant angular velocity and with the same orbital time period as the planet, $T=1$. S: Sun at the primary focus, C: Centre of ellipse, S': The secondary focus. In each case, the area of all sectors depicted is identical. ||

### Third law

Kepler's third law states that:
   The ratio of the square of an object's orbital period with the cube of the semi-major axis of its orbit is the same for all objects orbiting the same primary.
This captures the relationship between the distance of planets from the Sun, and their orbital periods.
Kepler enunciated in 1619 this third law in a laborious attempt to determine what he viewed as the "music of the spheres" according to precise laws, and express it in terms of musical notation. It was therefore known as the harmonic law. The original form of this law (referring to not the semi-major axis, but rather a "mean distance") holds true only for planets with small eccentricities near zero.
Using Newton's law of gravitation (published 1687), this relation can be found in the case of a circular orbit by setting the centripetal force equal to the gravitational force:
    $mr\omega ^{2}=G{\frac {mM}{r^{2}}}$
Then, expressing the angular velocity ω in terms of the orbital period ${T}$ and then rearranging, results in Kepler's Third Law:
    $mr\left({\frac {2\pi }{T}}\right)^{2}=G{\frac {mM}{r^{2}}}\implies T^{2}=\left({\frac {4\pi ^{2}}{GM}}\right)r^{3}\implies T^{2}\propto r^{3}$
A more detailed derivation can be done with general elliptical orbits, instead of circles, as well as orbiting the center of mass, instead of just the large mass. This results in replacing a circular radius, $r$, with the semi-major axis, $a$, of the elliptical relative motion of one mass relative to the other, as well as replacing the large mass $M$ with $M+m$. However, with planet masses being so much smaller than the Sun, this correction is often ignored. The full corresponding formula is:
    ${\frac {a^{3}}{T^{2}}}={\frac {G(M+m)}{4\pi ^{2}}}\approx {\frac {GM}{4\pi ^{2}}}\approx 7.496\times 10^{-6}{\frac {{\text{AU}}^{3}}{{\text{days}}^{2}}}{\text{ is constant}}$
where $M$ is the mass of the Sun, $m$ is the mass of the planet, $G$ is the gravitational constant, $T$ is the orbital period and $a$ is the elliptical semi-major axis, and ${\text{AU}}$ is the astronomical unit, the average distance from earth to the sun.

#### Table

The following table shows the data used by Kepler to empirically derive his law:
Data used by Kepler (1618) :
| Planet | Mean distance to sun (AU) | Period (days) | R$^3$/T$^2$ {\textstyle {\frac {R^{3}}{T^{2}}}} (10$^{-6}$ AU$^3$/day$^2$) |
| Mercury | 0.389 | 87.77 | 7.64 |
| Venus | 0.724 | 224.70 | 7.52 |
| Earth | 1 | 365.25 | 7.50 |
| Mars | 1.524 | 686.95 | 7.50 |
| Jupiter | 5.20 | 4332.62 | 7.49 |
| Saturn | 9.510 | 10759.2 | 7.43 |
Kepler became aware of John Napier's recent invention of logarithms and log-log graphs before he discovered the pattern.
Upon finding this pattern Kepler wrote:
   I first believed I was dreaming... But it is absolutely certain and exact that the ratio which exists between the period times of any two planets is precisely the ratio of the 3/2th power of the mean distance.
For comparison, here are modern estimates:
Modern data :
| Planet | Semi-major axis (AU) | Period (days) | a$^3$/T$^2$ {\textstyle {\frac {a^{3}}{T^{2}}}} (10$^{-6}$ AU$^3$/day$^2$) |
| Mercury | 0.38710 | 87.9693 | 7.496 |
| Venus | 0.72333 | 224.7008 | 7.496 |
| Earth | 1 | 365.2564 | 7.496 |
| Mars | 1.52366 | 686.9796 | 7.495 |
| Jupiter | 5.20336 | 4332.8201 | 7.504 |
| Saturn | 9.53707 | 10775.599 | 7.498 |
| Uranus | 19.1913 | 30687.153 | 7.506 |
| Neptune | 30.0690 | 60190.03 | 7.504 |

## Planetary acceleration

Isaac Newton computed in his Philosophiæ Naturalis Principia Mathematica the acceleration of a planet moving according to Kepler's first and second laws.
* The direction of the acceleration is towards the Sun.
* The magnitude of the acceleration is inversely proportional to the square of the planet's distance from the Sun (the inverse square law).
This implies that the Sun may be the physical cause of the acceleration of planets. However, Newton states in his Principia that he considers forces from a mathematical point of view, not a physical, thereby taking an instrumentalist view. Moreover, he does not assign a cause to gravity.
Newton defined the force acting on a planet to be the product of its mass and the acceleration (see Newton's laws of motion). So:
* Every planet is attracted towards the Sun.
* The force acting on a planet is directly proportional to the mass of the planet and is inversely proportional to the square of its distance from the Sun.
The Sun plays an unsymmetrical part, which is unjustified. So he assumed, in Newton's law of universal gravitation:
* All bodies in the Solar System attract one another.
* The force between two bodies is in direct proportion to the product of their masses and in inverse proportion to the square of the distance between them.
As the planets have small masses compared to that of the Sun, the orbits conform approximately to Kepler's laws. Newton's model improves upon Kepler's model, and fits actual observations more accurately. (See two-body problem.)
Below comes the detailed calculation of the acceleration of a planet moving according to Kepler's first and second laws.

### Acceleration vector

From the heliocentric point of view consider the vector to the planet $\mathbf {r} =r{\hat {\mathbf {r} }}$ where $r$ is the distance to the planet and ${\hat {\mathbf {r} }}$ is a unit vector pointing towards the planet. ${\frac {d{\hat {\mathbf {r} }}}{dt}}={\dot {\hat {\mathbf {r} }}}={\dot {\theta }}{\hat {\boldsymbol {\theta }}},\qquad {\frac {d{\hat {\boldsymbol {\theta }}}}{dt}}={\dot {\hat {\boldsymbol {\theta }}}}=-{\dot {\theta }}{\hat {\mathbf {r} }}$
where ${\hat {\boldsymbol {\theta }}}$ is the unit vector whose direction is 90 degrees counterclockwise of ${\hat {\mathbf {r} }}$, and $\theta$ is the polar angle, and where a dot on top of the variable signifies differentiation with respect to time.
Differentiate the position vector twice to obtain the velocity vector and the acceleration vector: ${\begin{aligned}{\dot {\mathbf {r} }}&={\dot {r}}{\hat {\mathbf {r} }}+r{\dot {\hat {\mathbf {r} }}}={\dot {r}}{\hat {\mathbf {r} }}+r{\dot {\theta }}{\hat {\boldsymbol {\theta }}},\\{\ddot {\mathbf {r} }}&=\left({\ddot {r}}{\hat {\mathbf {r} }}+{\dot {r}}{\dot {\hat {\mathbf {r} }}}\right)+\left({\dot {r}}{\dot {\theta }}{\hat {\boldsymbol {\theta }}}+r{\ddot {\theta }}{\hat {\boldsymbol {\theta }}}+r{\dot {\theta }}{\dot {\hat {\boldsymbol {\theta }}}}\right)=\left({\ddot {r}}-r{\dot {\theta }}^{2}\right){\hat {\mathbf {r} }}+\left(r{\ddot {\theta }}+2{\dot {r}}{\dot {\theta }}\right){\hat {\boldsymbol {\theta }}}.\end{aligned}}$
So ${\ddot {\mathbf {r} }}=a_{r}{\hat {\boldsymbol {r}}}+a_{\theta }{\hat {\boldsymbol {\theta }}}$ where the radial acceleration is $a_{r}={\ddot {r}}-r{\dot {\theta }}^{2}$ and the transversal acceleration is $a_{\theta }=r{\ddot {\theta }}+2{\dot {r}}{\dot {\theta }}.$

### Inverse square law

Kepler's second law says that $r^{2}{\dot {\theta }}=nab$ is constant.
The transversal acceleration $a_{\theta }$ is zero: ${\frac {d\left(r^{2}{\dot {\theta }}\right)}{dt}}=r\left(2{\dot {r}}{\dot {\theta }}+r{\ddot {\theta }}\right)=ra_{\theta }=0.$
So the acceleration of a planet obeying Kepler's second law is directed towards the Sun.
The radial acceleration $a_{\text{r}}$ is $a_{\text{r}}={\ddot {r}}-r{\dot {\theta }}^{2}={\ddot {r}}-r\left({\frac {nab}{r^{2}}}\right)^{2}={\ddot {r}}-{\frac {n^{2}a^{2}b^{2}}{r^{3}}}.$
Kepler's first law states that the orbit is described by the equation: ${\frac {p}{r}}=1+\varepsilon \cos(\theta ).$
Differentiating with respect to time $-{\frac {p{\dot {r}}}{r^{2}}}=-\varepsilon \sin(\theta )\,{\dot {\theta }}$ or $p{\dot {r}}=nab\,\varepsilon \sin(\theta ).$
Differentiating once more $p{\ddot {r}}=nab\varepsilon \cos(\theta )\,{\dot {\theta }}=nab\varepsilon \cos(\theta )\,{\frac {nab}{r^{2}}}={\frac {n^{2}a^{2}b^{2}}{r^{2}}}\varepsilon \cos(\theta ).$
The radial acceleration $a_{\text{r}}$ satisfies $pa_{\text{r}}={\frac {n^{2}a^{2}b^{2}}{r^{2}}}\varepsilon \cos(\theta )-p{\frac {n^{2}a^{2}b^{2}}{r^{3}}}={\frac {n^{2}a^{2}b^{2}}{r^{2}}}\left(\varepsilon \cos(\theta )-{\frac {p}{r}}\right).$
Substituting the equation of the ellipse gives $pa_{\text{r}}={\frac {n^{2}a^{2}b^{2}}{r^{2}}}\left({\frac {p}{r}}-1-{\frac {p}{r}}\right)=-{\frac {n^{2}a^{2}}{r^{2}}}b^{2}.$
The relation $b^{2}=pa$ gives the simple final result $a_{\text{r}}=-{\frac {n^{2}a^{3}}{r^{2}}}.$
This means that the acceleration vector $\mathbf {\ddot {r}}$ of any planet obeying Kepler's first and second law satisfies the inverse square law $\mathbf {\ddot {r}} =-{\frac {\alpha }{r^{2}}}{\hat {\mathbf {r} }}$ where $\alpha =n^{2}a^{3}$ is a constant, and ${\hat {\mathbf {r} }}$ is the unit vector pointing from the Sun towards the planet, and $r\,$ is the distance between the planet and the Sun.
Since mean motion $n={\frac {2\pi }{T}}$ where $T$ is the period, according to Kepler's third law, $\alpha$ has the same value for all the planets. So the inverse square law for planetary accelerations applies throughout the entire Solar System.
The inverse square law is a differential equation. The solutions to this differential equation include the Keplerian motions, as shown, but they also include motions where the orbit is a hyperbola or parabola or a straight line. (See Kepler orbit.)

### Newton's law of gravitation

By Newton's second law, the gravitational force that acts on the planet is: $\mathbf {F} =m_{\text{planet}}\mathbf {\ddot {r}} =-m_{\text{planet}}\alpha r^{-2}{\hat {\mathbf {r} }}$
where $m_{\text{planet}}$ is the mass of the planet and $\alpha$ has the same value for all planets in the Solar System. According to Newton's third law, the Sun is attracted to the planet by a force of the same magnitude. Since the force is proportional to the mass of the planet, under the symmetric consideration, it should also be proportional to the mass of the Sun, $m_{\text{Sun}}$. So $\alpha =Gm_{\text{Sun}}$ where $G$ is the gravitational constant.
The acceleration of Solar System body number i is, according to Newton's laws: $\mathbf {\ddot {r}} _{i}=G\sum _{j\neq i}m_{j}r_{ij}^{-2}{\hat {\mathbf {r} }}_{ij}$ where $m_{j}$ is the mass of body j, $r_{ij}$ is the distance between body i and body j, ${\hat {\mathbf {r} }}_{ij}$ is the unit vector from body i towards body j, and the vector summation is over all bodies in the Solar System, besides i itself.
In the special case where there are only two bodies in the Solar System, Earth and Sun, the acceleration becomes $\mathbf {\ddot {r}} _{\text{Earth}}=Gm_{\text{Sun}}r_{{\text{Earth}},{\text{Sun}}}^{-2}{\hat {\mathbf {r} }}_{{\text{Earth}},{\text{Sun}}}$ which is the acceleration of the Kepler motion. So this Earth moves around the Sun according to Kepler's laws.
If the two bodies in the Solar System are Moon and Earth the acceleration of the Moon becomes $\mathbf {\ddot {r}} _{\text{Moon}}=Gm_{\text{Earth}}r_{{\text{Moon}},{\text{Earth}}}^{-2}{\hat {\mathbf {r} }}_{{\text{Moon}},{\text{Earth}}}$
So in this approximation, the Moon moves around the Earth according to Kepler's laws.
In the three-body case the accelerations are ${\begin{aligned}\mathbf {\ddot {r}} _{\text{Sun}}&=Gm_{\text{Earth}}r_{{\text{Sun}},{\text{Earth}}}^{-2}{\hat {\mathbf {r} }}_{{\text{Sun}},{\text{Earth}}}+Gm_{\text{Moon}}r_{{\text{Sun}},{\text{Moon}}}^{-2}{\hat {\mathbf {r} }}_{{\text{Sun}},{\text{Moon}}}\\\mathbf {\ddot {r}} _{\text{Earth}}&=Gm_{\text{Sun}}r_{{\text{Earth}},{\text{Sun}}}^{-2}{\hat {\mathbf {r} }}_{{\text{Earth}},{\text{Sun}}}+Gm_{\text{Moon}}r_{{\text{Earth}},{\text{Moon}}}^{-2}{\hat {\mathbf {r} }}_{{\text{Earth}},{\text{Moon}}}\\\mathbf {\ddot {r}} _{\text{Moon}}&=Gm_{\text{Sun}}r_{{\text{Moon}},{\text{Sun}}}^{-2}{\hat {\mathbf {r} }}_{{\text{Moon}},{\text{Sun}}}+Gm_{\text{Earth}}r_{{\text{Moon}},{\text{Earth}}}^{-2}{\hat {\mathbf {r} }}_{{\text{Moon}},{\text{Earth}}}\end{aligned}}$
These accelerations are not those of Kepler orbits, and the three-body problem is complicated. But Keplerian approximation is the basis for perturbation calculations. (See Lunar theory.)

## Position as a function of time

Kepler used his two first laws to compute the position of a planet as a function of time. His method involves the solution of a transcendental equation called Kepler's equation.
The procedure for calculating the heliocentric polar coordinates (r,θ) of a planet as a function of the time t since perihelion, is the following five steps:
* Compute the mean motion n = (2π rad)/P, where P is the period.
* Compute the mean anomaly M = nt, where t is the time since perihelion.
* Compute the eccentric anomaly E by solving Kepler's equation: $M=E-\varepsilon \sin E,$ where $\varepsilon$ is the eccentricity.
* Compute the true anomaly θ by solving the equation: $(1-\varepsilon )\tan ^{2}{\frac {\theta }{2}}=(1+\varepsilon )\tan ^{2}{\frac {E}{2}}$
* Compute the heliocentric distance r: $r=a(1-\varepsilon \cos E),$ where $a$ is the semimajor axis.
The position polar coordinates (r,θ) can now be written as a Cartesian vector $\mathbf {p} =r\left\langle \cos {\theta },\sin {\theta }\right\rangle$ and the Cartesian velocity vector can then be calculated as $\mathbf {v} ={\frac {\sqrt {\mu a}}{r}}\left\langle -\sin {E},{\sqrt {1-\varepsilon ^{2}}}\cos {E}\right\rangle$, where $\mu$ is the standard gravitational parameter.
The important special case of circular orbit, ε = 0, gives θ = E = M. Because the uniform circular motion was considered to be normal, a deviation from this motion was considered an anomaly.
The proof of this procedure is shown below.

### Mean anomaly, M

The Keplerian problem assumes an elliptical orbit and the four points:
* s the Sun (at one focus of ellipse);
* z the perihelion
* c the center of the ellipse
* p the planet
and
* $a=|cz|,$ distance between center and perihelion, the semimajor axis,
* $\varepsilon ={|cs| \over a},$ the eccentricity,
* $b=a{\sqrt {1-\varepsilon ^{2}}},$ the semiminor axis,
* $r=|sp|,$ the distance between Sun and planet.
* $\theta =\angle zsp,$ the direction to the planet as seen from the Sun, the true anomaly.
The problem is to compute the polar coordinates (r,θ) of the planet from the time since perihelion, t.
It is solved in steps. Kepler considered the circle with the major axis as a diameter, and
* $x,$ the projection of the planet to the auxiliary circle
* $y,$ the point on the circle such that the sector areas |zcy| and |zsx| are equal,
* $M=\angle zcy,$ the mean anomaly.
The sector areas are related by $|zsp|={\frac {b}{a}}\cdot |zsx|.$
The circular sector area $|zcy|={\frac {a^{2}M}{2}}.$
The area swept since perihelion, $|zsp|={\frac {b}{a}}\cdot |zsx|={\frac {b}{a}}\cdot |zcy|={\frac {b}{a}}\cdot {\frac {a^{2}M}{2}}={\frac {abM}{2}},$ is by Kepler's second law proportional to time since perihelion. So the mean anomaly, M, is proportional to time since perihelion, t. $M=nt,$ where n is the mean motion.

### Eccentric anomaly, E

When the mean anomaly M is computed, the goal is to compute the true anomaly θ. The function θ = f(M) is, however, not elementary. Kepler's solution is to use $E=\angle zcx,$ x as seen from the centre, the eccentric anomaly as an intermediate variable, and first compute E as a function of M by solving Kepler's equation below, and then compute the true anomaly θ from the eccentric anomaly E. Here are the details. ${\begin{aligned}|zcy|&=|zsx|=|zcx|-|scx|\\with|scx|&={\frac {|cs|.|dx|}{2}}\\{\frac {a^{2}M}{2}}&={\frac {a^{2}E}{2}}-{\frac {a\varepsilon \cdot a\sin E}{2}}\end{aligned}}$
Division by a$^2$/2 gives Kepler's equation $M=E-\varepsilon \sin E.$
This equation gives M as a function of E. Determining E for a given M is the inverse problem. Iterative numerical algorithms are commonly used.
Having computed the eccentric anomaly E, the next step is to calculate the true anomaly θ.
But note: Cartesian position coordinates with reference to the center of ellipse are (a cos E, b sin E)
With reference to the Sun (with coordinates (c,0) = (ae,0) ), r = (a cos E – ae, b sin E)
True anomaly would be arctan(r$_{y/r}$x), magnitude of r would be √r · r.

### True anomaly, θ

Note from the figure that $|cd|=|cs|+|sd|$ so that $a\cos E=a\varepsilon +r\cos \theta .$
Dividing by $a$ and inserting from Kepler's first law ${\frac {r}{a}}={\frac {1-\varepsilon ^{2}}{1+\varepsilon \cos \theta }}$ to get $\cos E=\varepsilon +{\frac {1-\varepsilon ^{2}}{1+\varepsilon \cos \theta }}\cos \theta ={\frac {\varepsilon (1+\varepsilon \cos \theta )+\left(1-\varepsilon ^{2}\right)\cos \theta }{1+\varepsilon \cos \theta }}={\frac {\varepsilon +\cos \theta }{1+\varepsilon \cos \theta }}.$
The result is a usable relationship between the eccentric anomaly E and the true anomaly θ.
A computationally more convenient form follows by substituting into the trigonometric identity: $\tan ^{2}{\frac {x}{2}}={\frac {1-\cos x}{1+\cos x}}.$
Get ${\begin{aligned}\tan ^{2}{\frac {E}{2}}&={\frac {1-\cos E}{1+\cos E}}={\frac {1-{\frac {\varepsilon +\cos \theta }{1+\varepsilon \cos \theta }}}{1+{\frac {\varepsilon +\cos \theta }{1+\varepsilon \cos \theta }}}}\\[8pt]&={\frac {(1+\varepsilon \cos \theta )-(\varepsilon +\cos \theta )}{(1+\varepsilon \cos \theta )+(\varepsilon +\cos \theta )}}={\frac {1-\varepsilon }{1+\varepsilon }}\cdot {\frac {1-\cos \theta }{1+\cos \theta }}={\frac {1-\varepsilon }{1+\varepsilon }}\tan ^{2}{\frac {\theta }{2}}.\end{aligned}}$
Multiplying by 1 + ε gives the result $(1-\varepsilon )\tan ^{2}{\frac {\theta }{2}}=(1+\varepsilon )\tan ^{2}{\frac {E}{2}}$
This is the third step in the connection between time and position in the orbit.

### Distance, r

The fourth step is to compute the heliocentric distance r from the true anomaly θ by Kepler's first law: $r(1+\varepsilon \cos \theta )=a\left(1-\varepsilon ^{2}\right)$
Using the relation above between θ and E the final equation for the distance r is: $r=a(1-\varepsilon \cos E).$