Three bodies.
One simple law.
Every body pulls on every other body. That’s the easy part.
Predicting where they’ll go? Try it for yourself.
Starting conditions Position · velocity · mass
x = right, y = up. Arrows show velocity. Change the numbers, then apply to restart from your setup. Units are relative; G = 1.
What’s happening under the hood?
Newton’s gravity in two dimensions: aᵢ = Σ Gmⱼ(rⱼ − rᵢ) / |rⱼ − rᵢ|³, with G = 1. These are point masses; the colored circles are markers, not physical surfaces. There’s no friction, no wall, and no artificial force smoothing. The view zooms out if a body travels farther away.
An adaptive fourth-order Runge–Kutta solver takes smaller steps when necessary. ΔE reports numerical energy error, normalized by the initial kinetic energy plus the magnitude of potential energy. Very close approaches (below 0.015 distance units) or excessive numerical error pause the experiment. This is an educational numerical model, not an exact long-term prediction.
“Compare a tiny change” runs a second independent system with body A shifted right by just 0.005 units. Its hollow bodies and dashed trails show the difference. Try the triangle to watch the symmetry break; the figure eight is a special, relatively stable solution, so its nearby paths may stay close.
Figure-eight starting conditions: Richard Montgomery / Carles Simó.