At the beginning of the 17th century the German astronomer Johannes Kepler studied very precise measurements of the position of Mars collected by Tycho Brahe. After years of calculation he discovered three simple rules that all planets follow – Kepler's laws. Half a century later Isaac Newton showed that all three laws follow from his law of gravitation.
Choose a planet or set the semi-major axis a and the eccentricity e of the orbit yourself. The simulation calculates the motion from Newton's law of gravitation. The coloured sectors show the area swept by the Sun–planet line in each twelfth of the period (the second law), and the green arrow is the velocity of the planet. One orbit in the simulation takes about 10 seconds.
The planets move in ellipses, with the Sun at one focus of the ellipse.
An ellipse is a “flattened” circle. Half of its longest diameter is the semi-major axis a, and how flattened it is is shown by the eccentricity e (e = 0 is a circle, e close to 1 is a very elongated ellipse). The point of the orbit closest to the Sun is the perihelion (distance a(1 − e)), and the farthest is the aphelion (a(1 + e)). The orbits of the planets are almost circular (Earth: e = 0.017), while the orbits of comets are very elongated (Halley's comet: e = 0.967).
The line joining the Sun and a planet sweeps out equal areas in equal times.
That is why a planet moves faster near the Sun (at perihelion) and more slowly far from it (at aphelion): a narrow, long sector has the same area as a short, wide one. Earth is at perihelion in early January (about 30.3 km/s) and at aphelion in early July (about 29.3 km/s). At perihelion and aphelion rp · vp = ra · va. In the simulation: choose Halley's comet and watch it rush past the Sun, while far away it almost stands still.
The squares of the orbital periods of the planets are proportional to the cubes of the semi-major axes of their orbits.
T² / a³ = const (with T in years and a in AU: T² = a³, T = a^1.5)
The astronomical unit (AU) is the mean distance of the Earth from the Sun, about 150 million km. The farther a planet is from the Sun, the longer its period – and it grows faster than the distance.
| planet | a (AU) | T (years) | T² / a³ |
|---|---|---|---|
| Mercury | 0.387 | 0.241 | 1.00 |
| Venus | 0.723 | 0.615 | 1.00 |
| Earth | 1.000 | 1.000 | 1.00 |
| Mars | 1.524 | 1.881 | 1.00 |
| Jupiter | 5.203 | 11.86 | 1.00 |
| Saturn | 9.537 | 29.45 | 1.00 |
In the simulation: compare the “period from the 3rd law” and the “measured period” – they match, even though the simulation only uses the law of gravitation.
Newton explained why the planets obey Kepler's laws: the Sun attracts a planet with a force
F = G · m · M / r²
that weakens with the square of the distance. From this one force come the ellipses, the law of areas (the force always points towards the Sun) and the third law. The same force keeps the Moon around the Earth and artificial satellites in orbit.
Use T² = a³ (T in years, a in AU). Solve the problem, then check the solution (and in the simulation).
T = 4^1.5 = √(4³) = √64 = 8 years.
a³ = T² = 729, so a = ∛729 = 9 AU (roughly like Saturn).
T = 17.8^1.5 ≈ 75 years. It was last near the Sun in 1986, and the next time will be in 2061.
From the second law at perihelion and aphelion: rp · vp = ra · va, so va = 0.5 · 50 / 5 = 5 km/s – ten times slower.
a = (1 + 3) / 2 = 2 AU; e = (3 − 1) / (3 + 1) = 0.5; T = 2^1.5 ≈ 2.83 years. Set a = 2 and e = 0.5 in the simulation and check.
1. What shape are the orbits of the planets?
2. Where does a planet move fastest?
3. The semi-major axis of an orbit is 4 times larger. The orbital period is larger by:
4. What does Kepler's third law state?
5. An orbit has eccentricity e = 0. It is:
Related: circular motion (centripetal force) and the Sun, Earth and Moon animation in p5.js.
🛠 Build this kind of simulation yourself: Sun, Earth and Moon – animation in p5.js
💻 Program it yourself in p5.js: Kepler orbits in p5.js – gravity step by step
Kepler's laws – for teachers – lesson plan
Level: Secondary school (gravitation); extension work and astronomy club for ages 13–14
For Mercury, Earth, Mars and Jupiter students read the measured period from the simulation and calculate T² / a³; then for Halley's comet they compare the speed at perihelion and aphelion and check r · v = const. Finally they change the eccentricity at the same a and conclude that the period depends only on the semi-major axis.