🪐 Lagrange Points & Gravity Well 3D

See the five Lagrange points of any two-body system on a 3D effective-potential surface in the rotating frame. Computes L1–L5 distances, the Hill sphere and stability for Sun–Earth, Earth–Moon, Sun–Jupiter or your own masses, and launches test particles to show halo and tadpole orbits.

drag to orbit · scroll / pinch to zoom · double-click resets
Mass ratio μ = M₂/(M₁+M₂)
Orbital period
L1 from M₂ (toward M₁)
L2 from M₂ (away)
L3 from M₁ (opposite side)
L4 / L5
Hill sphere radius (M₂)
L4/L5 linearly stable?
How this works — the circular restricted three-body problem

Two masses orbit their common centre on circles. In a frame rotating with them, a third, tiny body feels gravity from both plus the centrifugal effect, which combine into an effective potential Ω = −(1−μ)/r₁ − μ/r₂ − ½(x² + y²) in units where R = 1, total mass = 1 and ω = 1. The surface you see is Ω (clipped near the masses); the five flat spots are the Lagrange points, where all forces balance.

Test particles are integrated in the rotating frame (including Coriolis) with RK4. Real Sun–Earth μ ≈ 3×10⁻⁶ makes the Earth's well invisible, so the picture exaggerates μ by default; all numbers always use the true masses. Sun–Earth L1/L2 come out ≈ 1.49–1.50 million km from Earth.