Orbital lab — 2D Kepler orbit plot

Switch to 3D
Controls
Live readouts
Numerical checks
What to try
  1. Watch the planet cross one coloured wedge in exactly T/12 whatever the shape of the orbit: Kepler II.
  2. Raise the eccentricity to 0.9: the planet crawls at apoapsis and sprints at periapsis, yet the areal-velocity graph stays flat.
  3. Quadruple the central mass at fixed a: the period halves (T proportional to 1/sqrt(M)).
  4. In the energy graph, kinetic and potential energy trade places while the total stays constant.
  5. Compare the measured speed with the vis-viva value in the readouts at any moment.
The science

A test mass moves in the inverse-square field of a central mass M. The orbit is a conic section; for a bound orbit it is an ellipse with the central body at one focus.

r̈ = −GM r / r³,   G = 4π² AU³ M☉⁻¹ yr⁻² Kepler II: dA/dt = L/2 = ½ r² θ̇ = const,   L = √(GM a (1−e²)) Kepler III: T² = a³ / M Vis-viva: v² = GM (2/r − 1/a),   E = −GM / 2a

The page integrates with the symplectic velocity-Verlet method (6000 steps per orbit, 40,000 in the checks). The wedge areas are computed from the exact solution of Kepler’s equation M = E − e sin E and a shoelace sum, independently of the integrator. Five checks compare period, apoapsis speed, wedge-area equality, areal-velocity conservation and energy conservation.

Simplifications: the planet is a test particle (no back-reaction), the star is a point, and there are no perturbations, relativity or tides.