ORBIT LAB
Newton's law of gravitation, integrated with velocity Verlet. It is symplectic, which is why an orbit here closes on itself for hours instead of slowly spiralling into the star — the usual fate of a naive simulation.
Drag anywhere on the sky to launch a body: where you press is where it starts, and the direction and length of the drag is its velocity. Scroll to zoom, right-drag to pan. A body that leaves the view is still out there — Fit View brings everything back on screen.
Measured from each body's position and velocity relative to the heaviest one, which is the
two-body approximation every orbit here is judged against. a is the semi-major
axis, e the eccentricity — 0 is a circle, below 1 an ellipse, 1 or more an
escape. The predicted period is Kepler's third law, T = 2π√(a³/μ);
where a third body matters, it will not be what you observe, and that discrepancy is the
three-body problem in one column.
Gravity is softened — the force uses √(r² + ε²) with a small
ε, shown in the readout above — so a dead-centre collision produces a fast slingshot instead of a
division by zero and an infinite velocity. Energy and momentum are computed with the same
softened potential, which is why the readout below stays honest even during a close pass.
"Three bodies. No closed-form solution. Only one way to find out what happens."