Skip to content

Orbit Sandbox

Learning goal

Kepler spent twenty years extracting three empirical laws from Tycho Brahe's observations. Newton showed all three follow from a single inverse-square force. This widget integrates that force and lets you watch all three laws appear — measured, not assumed.

The integrator is velocity Verlet, which is symplectic — energy stays bounded rather than drifting, so the orbit does not slowly spiral over long runs. Units are chosen so \(GM = 1\) and the launch radius is 1.

Things to try

  1. Press "circular". At exactly \(v = \sqrt{GM/r}\) the orbit closes into a circle: \(e = 0\), \(a = r_0\). Nudge the speed either way and it opens into an ellipse — with the launch point at perihelion if you slowed down, at aphelion if you sped up. The circle is a knife-edge case, which is worth knowing when people ask why planetary orbits are "nearly but not quite" circular.

  2. Watch the shaded wedge. It is the area swept in the last fixed interval. Near perihelion the body moves fast over a short radius; near aphelion, slow over a long one — and the wedge stays the same size. That is Kepler's second law, and the readout confirms \(dA/dt = L/2\) to one part in \(10^{11}\), constant to \(10^{-10}\) around the orbit.

Kepler II is just angular momentum conservation. It holds for any central force, not only inverse-square — which is why it was the easiest of the three for Kepler to find.

  1. Compare measured period against Kepler III. \(T = 2\pi\sqrt{a^3/GM}\), matched to better than 0.003% at every speed. Unlike the second law, this one is special to inverse-square: change the exponent and the relation between \(T\) and \(a\) changes with it.

  2. Press "escape speed". At \(v = \sqrt{2GM/r}\) the total energy is exactly zero and the orbit opens into a parabola — marginally unbound, arriving at infinity with nothing left over. Note that escape speed is \(\sqrt2\) times circular speed, always, at any radius. And note it does not depend on the direction you launch: energy is a scalar, so any direction works as long as you miss the planet.

  3. Launch at an angle. The orbit tilts but the shape depends only on \(E\) and \(L\). Try to find two different launch angles that give the same ellipse — you can, because only the two conserved quantities matter, not the details of how you arrived at them.

  4. Watch the faint blue conic. It is not fitted to the trajectory. It is computed from the instantaneous energy and angular momentum via \(a = -GM/2E\) and \(e = \sqrt{1 + 2EL^2/G^2M^2}\), and the body traces it because those two numbers determine the entire orbit. If the integrator were sloppy, the trail would drift off the prediction.

The vis-viva equation

The single most useful equation in orbital mechanics, and the readout checks it continuously:

\[v^2 = GM\left(\frac{2}{r} - \frac{1}{a}\right)\]

It ties speed to position on any conic. Setting \(r = a\) gives the circular speed; letting \(a\to\infty\) gives escape speed. Every orbital-transfer calculation — Hohmann transfers, gravity assists, insertion burns — is this equation applied twice.

What this model leaves out

  • One body, fixed centre. A real two-body system orbits its common centre of mass; for Sun–Earth the difference is tiny, for Pluto–Charon it is not.
  • No other planets. Their perturbations are what make the real solar system a hard problem — and their absence is why this orbit closes perfectly. Mercury's perihelion advances by 574 arcseconds per century, most of it from other planets and 43″ from general relativity.
  • No relativity, no drag, no oblateness. Each matters somewhere real.

The orbit closing exactly is a special property of the inverse-square law (Bertrand's theorem: only \(1/r^2\) and \(r^2\) forces give closed orbits). Nature's choice of exponent is doing a lot of work.

Kepler's laws & orbits · Gravitation · Newton's law of gravitation (eq.) · Conservation of energy · Circular motion · Rolling & angular momentum