← 🔭 Space & Astronomy

☄️ N-Body

Bodies: 300
FPS:
Time: 0 s
Scenario
Algo: Barnes-Hut
Central star
Small bodies
High velocity
Drag — rotate · Scroll — zoom

☄️ N-Body — Gravitational Simulation

3D real-time N-body gravity: watch stars, planets, and galaxies orbit, collide, and merge under Newton's universal law of gravitation.

🔬 What It Demonstrates

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.

🎮 How to Use

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.

💡 Did You Know?

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.