The Three-Body Problem
Nudge three stars on one gravity: from a figure-eight to pure chaos.
How to play
- Press on a star and drag out an arrow to nudge it: the arrow is its new velocity and the dotted line shows where it will go. Time pauses while you aim.
- Drag on empty space to add a star, or tap to drop one into a circular orbit around the nearest star.
- Watch the “Energy error” readout: it shows how faithfully the numbers are being followed.
- Try the three Challenges, or open Lab for other dances: Butterfly I, Moth I, Lagrange’s triangle, the Pythagorean problem and random chaos.
Challenges
- Nudge one star of the figure-eight and watch the dance fall apart
- Fling or nudge a star so it is thrown clean out of the system
- Add a fourth star that circles the whole trio calmly, far outside it
Try this
- Add a tiny 5% star near the figure-eight. Even this small nudge eventually wrecks the choreography.
- Run “Lagrange’s triangle”. It is a perfect solution, yet for equal masses it is unstable: watch it last a few turns and then fall apart.
- Run “Pythagorean 3-4-5” to the end. After a long chaotic dance the lightest star is thrown out and the other two leave as a tight pair.
Fun facts
- Henri Poincaré showed around 1890 that the motion of three bodies can be chaotic, which is why there is no general formula for it.
- The figure-eight orbit was found by computer by Cris Moore in 1993 and proved to exist by Alain Chenciner and Richard Montgomery in 2000.
- In 2013 Milovan Šuvakov and Veljko Dmitrašinović reported 13 new families of periodic three-body orbits, with names like butterfly, moth and yin-yang.
- Joseph-Louis Lagrange found in 1772 that three bodies can circle together at the corners of an equilateral triangle.
Why three is the hardest number
Two bodies under gravity are simple. Newton solved them completely: each follows an ellipse, a parabola or a hyperbola, forever. Add a third and the neat solution disappears. Each star pulls on the other two, which changes how they pull back, and the feedback never settles into a formula. In the 1880s and 1890s Henri Poincaré proved that such systems can be chaotic: two starting arrangements that differ by an invisible amount can end in completely different places.
So scientists solve the problem step by step with a computer, and that is what happens here. The simulation uses a fourth-order Yoshida method, built from three carefully weighted leapfrog steps, which keeps energy and momentum in check for very long runs. When two stars swing close, it shortens its time step automatically, following the rule h = 0.003·√(r³/G(m₁ + m₂)), so even the tightest flybys are traced faithfully. The “Energy error” readout shows the result: usually less than one part in a billion.
Islands of order
Chaos is not the whole story. Rare starting conditions repeat perfectly. In the figure-eight, three equal stars follow one another round a single curve, a choreography first found by computer in 1993 and proved mathematically in 2000. The Butterfly and Moth orbits come from a 2013 search that found 13 new families. We checked each preset with a separate high-precision calculation: they return to where they started after one period.
Being periodic is not the same as being stable. Lagrange’s rotating triangle is an exact solution, but for three equal masses the slightest wobble grows, so after a few turns it falls apart.
The Pythagorean problem
In 1913 Carl Burrau placed masses of 3, 4 and 5 at rest at the corners of a 3-4-5 right-angled triangle. They fall together, loop around one another wildly, and, as computers showed decades later, the lightest is finally ejected while the other two leave as a binary pair. We shrank the triangle to a third of its size and the masses to a quarter so it fits on screen; with gravity, that scaling changes only the speed of the movie, not its plot. Our run matches an independent high-accuracy calculation.
For the curious
Units: G = 1. Each star’s acceleration is the sum of G·m·(rⱼ − rᵢ)/|rⱼ − rᵢ|³ from the others, with no softening. The figure-eight starts with x₁ = −x₂ = (0.97000436, −0.24308753), x₃ = 0, v₃ = (−0.93240737, −0.86473146) and v₁ = v₂ = −v₃/2, and repeats every 6.3259 time units.
Questions people ask
Has the three-body problem been solved?
Not with a general formula, and Poincaré showed there cannot be a simple one. Special solutions exist, such as the figure-eight and Lagrange’s triangle, and computers can follow any particular case very accurately.
Is the three-body problem really chaotic?
Usually, yes. Tiny differences in starting positions grow quickly, so long-term predictions need extremely precise numbers. A few special orbits repeat exactly instead.
Why does one star often get thrown out?
In close three-way encounters, two stars can pair up into a tight binary and the energy released is given to the third, which can then escape completely.