The three-body problem
Two masses under gravity trace neat, predictable ellipses — Newton solved that in 1687. Add a third body and the system becomes chaotic: no closed-form solution exists, and the tiniest nudge sends the future spinning off in a wholly different direction. That sensitivity is what you're watching here.
Reading the sandbox
Energy below the HUD tells you if the system is bound (negative total energy — bodies stay gravitationally trapped) or unbound (positive — something is escaping to infinity). A good integrator keeps total energy roughly constant; if it drifts, lower dt.
Softening (ε) replaces the real 1/r² force with 1/(r²+ε²) near contact, so two bodies grazing each other don't blow up to infinite force. It's the standard trick in galaxy simulations.
Controls
Drag to pan · scroll to zoom · right-click the canvas to add a body (drag to aim it, hold to make it heavier) · drag any body to reposition it · double-click a body to follow it.
Move / Add toolV / A
Play / pauseSpace
Single step.
Reset presetR
Clear trailsC
Fit to viewF
Time warp ¼ / 1 / 4 / 16×1–4
Zoom in / out+ / −
Reverse timeT
Undo last addZ
Name labels / gridL / G
ScreenshotS
Remove selected⌫
Collisions & tides
The default Realistic collision mode decides each impact's fate from its speed relative to the pair's mutual escape velocity: slow hits accrete, grazing fast hits are hit-and-run, and head-on fast hits crater or shatter the smaller body — the same regimes planetary scientists model. With Tidal disruption on, a light body that strays inside a giant's Roche limit is torn into a string of fragments, no contact needed.
Extras
Switch to Advanced (top bar) for the gravity-field heatmap, Lagrange-point markers, path prediction, gas drag (circularises debris — that's how the Moon forms in the giant-impact preset) and integrator controls. View tilt slants the orbital plane for a 3-D look. 🎬 Tour (Presets tab) auto-plays the whole catalogue. ⏪ Reverse flips every velocity — a symplectic integrator retraces its own steps almost perfectly. ⏺ Record captures the canvas straight to WebM. Click a body's name in the inspector to rename it, and use the m/v buttons there to sculpt orbits live.
Orbital integrates Newtonian gravity with a symplectic velocity-Verlet scheme in a barycentric frame. Built as a single HTML file — no servers, no tracking. Part of jackblaker.com.