WebGL is not available.
This sandbox needs a WebGL2-capable browser.

GravityN-Body & Black Hole Sandbox

Selected body

Click a body to inspect it. Drag on empty space to launch a new one.

Diagnostics

t = 0forward 1.00×

Keyboard & mouse

Pause / playSpace
Reverse timeR
Slower / faster[ ]
Presets1…8
Spacetime gridG
BloomB
Top-down 2DT
Follow selectedF
LabelsL
Merge on collisionK
Delete selectedX Del
Next bodyTab
Clear trailsC
Reset viewV
Reset scene⌫
MuteM
Spawn star (black hole)S
Deselect / closeEsc

Mouse: click a body to select it. Drag from empty space to launch a new body — the drag vector is its velocity and the dotted line previews its path (integrated forward in the live field). Right-drag orbits, Shift+right-drag or middle pans, wheel zooms. Touch: one finger launches, two fingers orbit/zoom (or enable “Left-drag orbits camera”).

Reverse runs the leapfrog integrator with negative dt, so orbits retrace exactly until a merge or absorption (irreversible) happens. Energy drift is measured on the gravitating bodies and is rebased whenever bodies are added, removed or merged.