This is the 2D companion to the 3D "Lagrange Points" laboratory. It solves the same restricted three-body problem but renders it top-down as a real effective-potential contour map instead of a 3D height field, and integrates test-particle motion with the same rotating-frame equations of motion.
Phi_eff(x,y) = -(1-mu)/r1 - mu/r2 - 1/2 (x^2+y^2)
ax = 2 vy + x - (1-mu)(x+mu)/r1^3 - mu(x-1+mu)/r2^3
ay = -2 vx + y - (1-mu) y /r1^3 - mu y /r2^3
- L1, L2, L3 are solved live with Newton's method as roots of dPhi/dx = 0 along the line joining the bodies, from the actual mass ratio μ you set — not hardcoded positions.
- L4, L5 sit exactly 60° from the line joining the bodies (equilateral triangle) — an exact analytic result, independent of μ.
- The contour map is the real Jacobi effective potential, sampled on a grid and quantised into bands so equal-potential contours are visible, exactly as topographic contour lines mark equal elevation.
- Click anywhere on the canvas, or use "Launch at point", to drop a test particle. Its trajectory is integrated with 4th-order Runge-Kutta including gravity from both bodies plus the Coriolis (2·omega×v) and centrifugal terms of the rotating frame — the same physics that lets Trojan asteroids and JWST hover near their Lagrange point.
- For typical mass ratios (Sun-Earth, Sun-Jupiter, Earth-Moon) a particle near L1-L3 drifts away while one near L4/L5 librates in a slow loop — genuine numerical stability, not a scripted outcome.