The figure-eight is a real, exactly-periodic solution to the three-body problem — found by Cris Moore in 1993 and proved to exist in 2000. Three equal masses chase each other around the same curve forever. Nudge it and it dies.
Total energy and momentum should stay put. If total energy is negative the system is bound — nothing is getting away.
Every body here pulls on every other body with the same law Newton wrote down in 1687:
For two bodies that's it — Kepler and Newton closed the problem completely. The orbit is always a conic section: a circle, an ellipse, a parabola or a hyperbola, forever, exactly, with a formula you can write on a napkin.
Add a third body and the whole thing collapses. Poincaré proved in the 1880s that there is no general closed-form solution — and in the process accidentally discovered chaos. The only way to know where three gravitating bodies will be is to do what this page is doing: step time forward in tiny increments and watch.
Integrator: velocity Verlet at a fixed step, with softened gravity at very close range so a direct hit doesn't launch a body to infinity. Keyboard: space pause · C clear · T trails.