Three-Body Problem Illustrator

An interactive visualization of the famous three-body problem in celestial mechanics. Explore various orbital configurations including the Figure-Eight orbit, Lagrange central configurations, and chaotic trajectories with real-time physics simulation.

Live Simulation

Select different presets to explore various three-body configurations. Use the controls to adjust playback speed, sampling density, and visualization parameters.

What is the three-body problem?

The Newtonian three-body problem asks for the motion of three point masses interacting only through gravity. Unlike the two-body problem, which is integrable with closed-form Keplerian orbits, the three-body problem is generally non-integrable. Trajectories can be periodic, quasi-periodic, or chaotic, and the long-term outcome (stable triple, exchange reactions, or ejection) depends sensitively on the initial conditions.

Equations of motion (planar, equal masses)

We consider three equal masses \(m_1=m_2=m_3=1\) moving in a plane with \(G=1\) (dimensionless units). Let \(\mathbf r_i(\tau)=(x_i,y_i)\) and \(\mathbf v_i=\dot{\mathbf r}_i\). The accelerations are:

\[ \ddot{\mathbf r}_i = \sum_{j\ne i} \dfrac{\mathbf r_j-\mathbf r_i}{\lVert \mathbf r_j-\mathbf r_i \rVert^3}, \quad i\in\{1,2,3\} \]

These equations are invariant under translations, rotations, and the Kepler scaling:

\[ \mathbf r\mapsto \lambda \mathbf r,\quad \tau\mapsto \lambda^{3/2}\tau,\quad \mathbf v\mapsto \lambda^{1/2}\mathbf v \]

Conserved quantities (invariants)

  • Total momentum: \( \mathbf P=\sum_i m_i \mathbf v_i \) is constant. In the center-of-mass (COM) frame:
    \[ \mathbf P=\mathbf 0, \quad \mathbf R_{\mathrm{COM}}=\tfrac{1}{M}\sum_i m_i\mathbf r_i=\mathbf 0 \]
    with \( M=\sum_i m_i \).
  • Angular momentum: conserved (a scalar in 2D):
    \[ L_z=\sum_i m_i \, (\mathbf r_i\times \mathbf v_i)\cdot \hat{\mathbf z} \]
  • Energy: constant with kinetic and potential terms:
    \[ E=T+U, \quad T=\tfrac12 \sum_i m_i \lVert \mathbf v_i\rVert^2, \quad U=-\sum_{i<j}\dfrac{m_i m_j}{\lVert \mathbf r_i-\mathbf r_j\rVert} \]
    For bound motion, the time-averaged virial relation:
    \[ 2\langle T\rangle+\langle U\rangle=0 \]

Why it is hard

The system lacks enough global integrals for a closed-form solution; small perturbations can grow rapidly (sensitive dependence on initial data). Close approaches produce large accelerations and strong exchange of energy and angular momentum between temporary subsystems (a transient binary plus a third body), driving rich and often chaotic dynamics.

What is shown here

The visualization displays planar, equal-mass three-body dynamics in the COM frame. Presets illustrate:

  • Figure-eight choreography: a periodic, zero-angular-momentum orbit in which the three bodies chase one another along the same lemniscate-shaped curve, offset by one third of the period.
  • Lagrange equilateral (central configuration): a uniformly rotating equilateral triangle; small perturbations induce collective “breathing” or breakup.
  • Euler collinear (central configuration): all three lie on a line and rotate as a rigid figure; generically unstable.
  • Hierarchical triple: an inner binary plus a distant third body with secular modulation, resonant energy exchange, and possible ejection or partner swap.

Qualitative behaviors to look for

  • Temporary capture & exchange: the identity of the binary changes over time.
  • Resonances & secular cycles: commensurate inner/outer frequencies amplify eccentricity and orientation oscillations.
  • Chaos: nearby initial conditions decorrelate quickly in phase space and in the trails you see.
  • Scattering/ejection: one body can escape with \(E\ge 0\), leaving a tighter (“harder”) recoil binary.

Central configurations & choreographies

A central configuration is a shape whose accelerations are proportional to positions in a uniformly rotating frame; equilateral (Lagrange) and collinear (Euler) are the classical examples. A choreographyis a periodic solution where all bodies traverse the same curve with equal time shifts; the figure-eight is the most famous equal-mass example with \(L_z=0\).

Singularities & near-collisions

Binary or triple collisions are singular in the Newtonian model. Away from collision data, solutions exist for all time, but near-collisions are extremely stiff and dominate dramatic outcomes (slingshots, exchanges). The minimum pairwise distance spikes at such events:

\[ r_{\min}(\tau)=\min_{i<j}\lVert \mathbf r_i-\mathbf r_j\rVert \]

Scaling intuition

If lengths scale by \( \lambda \), then:

\[ \tau \mapsto \lambda^{3/2}\tau, \quad \mathbf v \mapsto \lambda^{1/2}\mathbf v \]

Tighter triples evolve faster with larger characteristic speeds.

Educational Impact

This interactive simulation highlights core ideas in celestial mechanics — invariants, central configurations, hierarchical structure, and chaos — in the simplest non-integrable gravitational system.