Back

Three-body problem

Change masses and gravity in a normalized three-body model. Compare trajectories and conserved quantities in linked 2D and rotatable 3D views.

Inputs
Results
—
Total energy E
—
Angular momentum L
—
Elapsed time t
—
Recorded trail points
—
E change from reference
—
L change from reference

Positions, trails and forces

Click or tap to reposition the nearest body and set its velocity to zero. Keyboard: choose body1–3, then move it with arrow keys. Editing resets time and conservation references.

3D view: world lines with time as height

Drag horizontally or use the arrow keys to rotate the camera; double-click (double-tap) restores the initial view. Vertical gestures scroll the page. The motion stays in the plane and height shows time (older samples are lower; trails fade with age). Both views fit the bodies and trails around the center of mass; body symbols are schematic. Velocity and force arrows use different illustrative scales.

Conserved quantities and state values
Kinetic energy KE: —
Potential energy PE: —
Total energy E: —
Angular momentum L: —
Momentum px: —
Momentum py: —
BodyMassxyvxvy

Feedback
Send us your comments or bug reports

Inputs and interaction

The three-body problem describes three point masses attracting each other. Mass, distance, time and G here use normalized model units, not an ephemeris for real celestial objects. Changing a mass or G rebuilds the initial positions and velocities and pauses. Changing only trail capacity preserves the current motion.

Play, pause, single-frame stepping and0.25×/1×/3× playback remain available. One frame advances0.002×playback multiplier in model time. Reset starts at time0 with only the initial trail point. Shared links restore current positions, velocities, inputs and conservation references, paused. Trail history and camera are not saved.

Checkable examples

Choose the circular triangle with all masses1 and G1. Side length is1 and each body is1/√3 from the center of mass. With ε=0.02, ω≈1.73153137, period≈3.62868695, E≈−1.50029973 and L≈1.73153137. Initial velocities also match the model force after changing masses or G.

At time0 for the figure-eight layout with all masses1 and G1, KE≈1.21285800, PE≈−2.49957511, E≈−1.28671711 and L=0. Distinguish the paper’s equal-mass Newtonian orbit from this softened approximation. For a lighter third body in the binary-style layout, try m₁=m₂=1 and m₃=0.1. A preset name does not establish stability.

Model and scope

Acceleration and potential use the same ε=0.02. Integration uses a sixth-order symmetric symplectic composition of velocity Verlet (Yoshida type), with fixed Δt=0.0000125. The triangle formula applies when all pair distances equal s. Coordinates are centered on the mass-weighted center, and velocities use total mass M=Σmᵢ.

Acceleration (with softening ε)$$\mathbf a_i=G\sum_{j\ne i}\frac{m_j(\mathbf r_j-\mathbf r_i)}{(\lVert\mathbf r_j-\mathbf r_i\rVert^2+\varepsilon^2)^{3/2}}$$Total energy$$E=\frac12\sum_i m_i\lVert\mathbf v_i\rVert^2-G\sum_{i\lt j}\frac{m_i m_j}{\sqrt{\lVert\mathbf r_i-\mathbf r_j\rVert^2+\varepsilon^2}}$$Angular momentum (z component)$$L_z=\sum_i m_i(x_i v_{y,i}-y_i v_{x,i})$$Angular velocity of the triangular solution$$\omega^2=\frac{G M}{(s^2+\varepsilon^2)^{3/2}}$$

Both views automatically fit the bodies and trails. Camera rotation does not add out-of-plane gravity dynamics. Relativity, tides, collisions and dissipation are omitted. Softening removes the force singularity, but not accumulated numerical error or sensitivity to initial conditions. When reference E or L is near zero, an absolute change replaces a percentage.

Is the triangular solution stable?

Circular initial conditions and stability against perturbations are different. The selected masses and G determine the force balance, but numerical error and changed initial data can distort the triangle.

Is the figure-eight exact here?

The cited paper concerns an equal-mass Newtonian periodic orbit. This tool softens forces with ε=0.02 and permits different masses and G, so the preset is an approximate initial layout.

Must random layouts become chaotic or eject a body?

No. Behavior depends on positions, velocities and masses. Moving far away or outside a view is not by itself a determination of permanent escape.

Does small energy drift prove an accurate trajectory?

Conservation changes are useful diagnostics but do not certify a long-term individual trajectory. Position and velocity convergence and the model assumptions also matter.

Chenciner & Montgomery — Figure EightRichard Montgomery — Initial DataPrinceton — Lagrange OrbitsYoshida — Symplectic Integrators

🎬 Watch it in motion

This is the fingerprint of chaos | Three-body problem #Shorts
This is the fingerprint of chaos | Three-body problem #Shorts
Newton solved the two-body case | Three-body problem #Shorts
Newton solved the two-body case | Three-body problem #Shorts
Two bodies solve. Three break. | Three-body problem #Shorts
Two bodies solve. Three break. | Three-body problem #Shorts
No formula exists | Three-body problem #Shorts
No formula exists | Three-body problem #Shorts
Gravity's butterfly effect | Three-body problem #Shorts
Gravity's butterfly effect | Three-body problem #Shorts
A third body makes it erupt | Three-body problem #Shorts
A third body makes it erupt | Three-body problem #Shorts
Lagrange Points | Five Balance Points in Space #Shorts
Lagrange Points | Five Balance Points in Space #Shorts
Three stars dance one figure-8. | Three-body problem #Shorts
Three stars dance one figure-8. | Three-body problem #Shorts