# Interactive Three-Body Problem Simulator for Orbital Chaos
The three-body problem is one of the clearest demonstrations that simple laws can produce complicated motion. Newtonian gravity gives a compact force rule, but the moment a third massive body joins the system, each orbit continuously reshapes the other two. This simulator lets you experiment with that instability directly: choose a known configuration, adjust masses and velocity vectors, and watch whether the bodies form a repeating orbit, a rotating triangle, or a chaotic scattering event.# What the Presets Demonstrate
| Preset | Physical idea | What to look for |
|---|---|---|
| Figure eight | A periodic equal-mass solution where all three bodies share the same loop. | The orbit remains organized only when symmetry and velocity balance are carefully preserved. |
| Lagrange triangle | Three bodies occupy an equilateral triangle that rotates around the center of mass. | Mass balance and tangential velocity keep the triangle from collapsing inward. |
| Slingshot | A close encounter transfers energy between bodies. | One body can gain speed while another becomes more tightly bound, revealing why chaotic ejections occur. |
# Why Small Changes Matter
In a two-body orbit, the center of mass and orbital ellipse provide a stable geometric picture. In a three-body system, close passes act like gravitational negotiations: a body can borrow orbital energy, change direction sharply, or convert an orderly loop into a scattering event. That sensitivity is why real astrophysical systems such as triple stars, planet-moon encounters, and early solar-system planetesimals often require numerical integration rather than a single neat formula.# How to Use the Diagnostics
- Total energy helps you judge whether the system is bound and whether the numerical integration is staying stable.
- Separation range shows the closest and farthest pair distances, making near-collisions and ejections easy to spot.
- Center of mass should remain relatively steady when the initial momentum is balanced; drift suggests an intentionally asymmetric setup or a changed velocity vector.
- Trail length reveals long-term structure: short trails emphasize the current interaction, while long trails expose repeating loops and slow orbital precession.