Place masses in the plane and watch them gravitationally interact—create binary systems, slingshots, or chaotic orbits
This simulation demonstrates the gravitational interactions between multiple bodies in a planar system. Each body attracts every other body according to Newton's law of universal gravitation: F = G m₁ m₂ / r²
The simulation uses the Runge-Kutta 4th order (RK4) method to integrate the equations of motion. This provides a good balance between accuracy and computational efficiency for orbital mechanics. For very long-term stability, symplectic integrators like Verlet would be preferred, but RK4 is sufficient for the timescales shown here.
In an isolated N-body system with only gravitational forces:
While the two-body problem has a closed-form solution (Kepler orbits), the three-body problem generally does not. Henri Poincaré proved in the 1890s that the general three-body problem is non-integrable, meaning there's no simple formula for the motion. This was one of the first demonstrations of deterministic chaos in classical mechanics.