Home▸Space & Astronomy▸N-Body Gravity Simulation (2D)

🪐 N-Body Gravity Simulation (2D)

Interactive 2D N-body gravitational simulation with RK4 numerical integration. Real pairwise inverse-square gravity between every body. Add bodies by clicking, adjust gravity and time speed, load solar/binary/figure-8/random presets, and watch orbits, resonances and chaos unfold.

Space & Astronomy2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-n-body ↗ Open standalone
⚙ Under the hood

A real N-body gravitational simulator in 2D: every body attracts every other body with Newtonian inverse-square gravity, integrated with fourth-order Runge-Kutta. Click to add bodies, tune gravity strength and time speed, and load solar, binary, figure-8 or random presets to explore orbits, resonances and chaotic three-body dynamics.

gravityorbital-mechanicsn-bodychaosastrophysics

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)