THE MANIFOLDTHE WORKSHOP / 001

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.

READY TO EXPLORE
TIME 0.00ΔE 0.000%
Three gravitationally interacting bodiesBodies A, B, and C attract one another. While paused, drag a body to change its position or its arrow tip to change its velocity. All values are also editable in Starting conditions.
A B C◌ Dashed = tiny change
Drag a body or an arrow tip to set it in motion.

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.

Mass: 0.1–10. Position: ±20. Velocity: ±5.

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ó.