Presets
Playback
Launch
Where the body starts, how fast, and in which direction. Circular speed is 1.00.
Central body and force
The mass of the central body and an optional extra 1/r^3 attraction that makes the orbit precess.
Drawing
Trail length and the number of equal-time sectors.
Layers
Model checks
The science
One body, one force
A small body of negligible mass moves in the gravity of a central mass M. The acceleration is a = -GM r̂ / r2. Lengths are in astronomical units and time in years, so for the Sun GM = 4π2 AU3/yr2; other central masses are given as multiples of that. The page integrates the motion with the velocity-Verlet (leapfrog) scheme with a step that shrinks near the centre; it is symplectic, so energy does not drift.
Conserved quantities
Specific energy E = v2/2 - GM/r and specific angular momentum L = r vt are constant. Everything else follows: semi-major axis a = -GM/(2E) (bound orbits, E < 0), eccentricity e = √(1 + 2 E L2/(GM)2), periapsis and apoapsis a(1 − e) and a(1 + e), period T = 2π √(a3/GM). The speed anywhere is the vis-viva relation v2 = GM (2/r - 1/a).
Effective potential
Split the kinetic energy into radial and sideways parts: E = vr2/2 + Ueff(r) with Ueff = L2/(2 r2) - GM/r. The centrifugal term keeps the body from falling in. The orbit can only exist where E ≥ Ueff; the two crossings are the periapsis and the apoapsis. A circular orbit sits at the bottom of the well, E = 0 is the parabolic threshold, and above it the body escapes.
Kepler's three laws
(1) Bound orbits are ellipses with the central body at one focus. (2) The line to the body sweeps equal areas in equal times, because dA/dt = L/2; the shaded sectors all have the same area. (3) T2/a3 = 4π2/GM for every orbit around the same body.
Perihelion shift
An extra attraction from the potential -β/r3 (the first correction of general relativity has this form) breaks the closed ellipse. To first order the orbit's long axis advances by δϖ = 6π β GM / L4 radians per revolution. With the slider at zero the ellipse closes exactly. The strength is exaggerated by a large factor so the effect is visible in a few revolutions; the real effect for Mercury is 43 arcseconds per century.
Model checks on this page
(1) The numerical time between two periapsis passages is compared with 2π√(a3/GM). (2) The integrated speed at periapsis and apoapsis is compared with vis-viva. (3) With the extra force switched on, the measured advance of the periapsis direction per orbit is compared with 6πβGM/L4.
Honest simplifications
Two-body problem with the central mass fixed (the small body does not pull back), point masses, no drag, no other planets, no relativity except the optional shift term, which is a first-order stand-in rather than the full relativistic equations.
What to try
Start with Circular orbit: the ball sits at the bottom of the potential well. Pick Earth-like ellipse or Comet and watch the sectors: they look different but have equal areas. Raise the launch speed to 1.41 (the escape speed) and the orbit opens into a parabola, then a hyperbola. Use Precessing orbit and count how far the ellipse turns per revolution against the number in the readouts. Change the central mass and see that T^2/a^3 changes but stays the same for all orbits of one star.