3D real-time N-body gravity: watch stars, planets, and galaxies orbit, collide, and merge under Newton's universal law of gravitation.
Every particle gravitationally attracts every other (O(N²) interactions, optimised with a Barnes-Hut octree). Stable orbits, hyperbolic trajectories, orbital resonances, and three-body chaotic motion all emerge naturally.
Click to add bodies; drag to give initial velocity. Choose presets: solar system, binary stars, figure-8 orbit, or galactic collision. Adjust gravitational constant G and time-step with sliders.
The three-body problem — predicting three gravitating masses — has no closed general solution. Henri Poincaré proved this in 1887, marking the birth of chaos theory, 76 years before Lorenz's weather work.