PHYSICS LAB / 04
Three-Body Orbit
Explore how three masses shape one another’s motion through gravity.
Three interacting bodies rarely follow simple closed-form paths. Each body accelerates under the combined gravitational influence of the other two, so trajectories are integrated numerically. Some configurations are periodic or hierarchical; arbitrary configurations are not guaranteed to be stable. Coordinates are in metres (x right, y up); the canvas uses screen pixels only for display.
Orbital workspace · world coordinates
Simulation time 0.000 sDrag canvas to pan · wheel or buttons to zoom
Status ReadyIntegrator RK4Steps 0Closest approach —
Body radius uses a restrained square-root mass mapping for visibility. Velocity arrows share a fixed scale; acceleration arrows are auto-scaled for visibility. Softening ε = 0.05 m is applied to both force and potential energy to regularize close encounters.
Energy vs time · J
K kinetic · U potential · E mechanical
Momentum vs time · kg·m/s
Px horizontal · Py vertical
Angular momentum vs time · kg·m²/s
Pair distance vs time · m
Physics notes
Newtonian gravity follows an inverse-square law. Pairwise forces act in equal and opposite directions, and the acceleration of each body is the sum of the pulls from the other two. Momentum and angular momentum should remain nearly constant; mechanical energy drift depends on timestep and trajectory.
aᵢ = G Σⱼ mⱼ(rⱼ − rᵢ) / (|rⱼ − rᵢ|² + ε²)³ᐟ² · U = −Σᵢ<ⱼ Gmᵢmⱼ / √(rᵢⱼ² + ε²) · ε = 0.05 m