Orbit Simulator: Planets, Gravity and Kepler's Laws
A free orbit and gravity simulator: launch planets and comets by dragging, watch the inner planets, Halley's comet, Jupiter's Trojans, the Moon, a gravity assist and the figure-eight three-body orbit, see Kepler's laws and equal areas live, and compute orbit speeds, periods and Hohmann transfers.
Real gravity, many bodies. Pick a system below, or drag from any empty spot to launch a planet: the arrow is its velocity (a drag as long as its distance from the star is a circular orbit). Drag a body to move it, click one to see its orbit, wheel or pinch to zoom, right-drag to pan.
Real numbers for real orbits, in SI units from the same laws. Choose the body that is being orbited, then type distances like 400 km, 1 AU or 6778000 m (a bare number means km).
A circular orbit
Kepler's third law
Speed anywhere on an orbit (vis-viva)
Hohmann transfer (two burns)
Idealised: point masses, circular and coplanar orbits, instant burns, no atmosphere. G = 6.6743×10⁻¹¹ m³ kg⁻¹ s⁻². Body data are standard published values.
How orbits work
An orbit is a fall that keeps missing. Newton imagined firing a cannonball from a mountain: faster and faster, it lands farther away, until the ground curves away as fast as the ball falls and it never lands. The Moon, the planets and the Space Station are all doing exactly that, pulled by gravity and moving sideways fast enough to keep missing. This page adds the pull of every body on every other body, step by step, which is all that gravity is: no ellipses are drawn in advance, they come out of the arithmetic.
Kepler's three laws, and where to see them here
- 1. Orbits are ellipses with the star at one focus. Select a planet and tick the dashed orbit: it is the ellipse worked out from that body's position and velocity right now. A drag as long as its distance gives a circle (e = 0); a faster launch stretches it into a long ellipse; faster than √2 times circular and it never returns.
- 2. Equal areas in equal times. Select Halley's comet and tick “Equal areas”: the orbit is cut into twelve slices of equal time. The long thin ones near the Sun and the short fat ones far away have the same area (the table under the picture shows the numbers). That is conservation of angular momentum.
- 3. T² ∝ a³. In the Inner planets system the last column shows T²/a³ for each planet. In years and AU it is 1 for every one of them.
Things to try
- Launch from the Sandbox: pull the drag out to the same length as the distance from the Sun for a circular orbit, shorter for a falling ellipse, longer for a far-flung one. Make it a bit longer than 1.41 times and watch it escape.
- Gravity assist: in “Gravity assist at Jupiter” the probe's orbit gets bigger without any rocket. It takes a little of Jupiter's orbital energy, which Jupiter never notices (its mass is a billion billion times larger).
- Figure-eight, Lagrange and the Pythagorean problem: three bodies are already a hard problem: there is no general formula. Some special cases are stable and beautiful, most are chaotic. Move one body in the figure-eight by a hair and see what happens.
- Jupiter's Trojans: an asteroid 60° ahead of Jupiter stays there for ever: the Lagrange point L4. The same trick keeps two camps of thousands of asteroids, the Greeks and the Trojans, travelling with Jupiter.
- Planet around two stars: a planet far from a close pair behaves as if it orbited one star with the combined mass. Move it closer and it gets thrown out.
How accurate is it?
The sum of all the gravity is solved with a fourth-order symplectic integrator (Yoshida) whose step shrinks automatically during close encounters. In the table, “Energy kept to” shows how much the total energy has drifted since the start: for the Earth about 10⁻¹⁰ per decade, for the figure-eight the three bodies return to their starting points within a millionth after a lap. Limits: Newtonian gravity in two dimensions with point masses, so no relativity (Mercury's precession is not reproduced; try the Black Hole Simulator for that), no tides, no collisions unless you tick “Merge when bodies touch”, and no other bodies than the ones you see (the planets' real neighbours, asteroids and spacecraft are not included).
Everything runs on your device and nothing is uploaded. Black Hole Simulator · Metric Tensor Explorer · Solar System Today · More MES tools
