← back to blog

Kepler’s third law relates the orbital period \(T\) to the semi-major axis \(a\) for a body orbiting a mass \(M\):

$$ T = 2\pi \sqrt{\frac{a^3}{GM}}. $$

For Earth around the Sun, using \(a = 1.496 \times 10^{11}\,\mathrm{m}\) and \(GM = 1.327 \times 10^{20}\,\mathrm{m^3\,s^{-2}}\), we expect roughly one year.

import math

GM = 1.32712440018e20
a = 1.495978707e11

period_seconds = 2 * math.pi * math.sqrt(a**3 / GM)
print(period_seconds / (365.25 * 24 * 3600))
1.0000

Reference values

BodySemi-major axis (AU)Period (years)
Mercury0.3870.241
Earth1.0001.000
Mars1.5241.881
Jupiter5.20311.862

The point is not the arithmetic. The point is that a notebook can carry the claim, the code, and the output together.

/comments