Selected asteroid: none
Click an asteroid to select it, then nudge its position/velocity to test whether it stays trapped.
Trojan asteroids share a planet's orbit around the Sun, trapped in a 1:1 resonance 60° ahead (L4) or 60° behind (L5). This simulation numerically integrates the real restricted three-body problem in the co-rotating frame to show why these two points trap thousands of asteroids while the other three Lagrange points do not.
In the frame rotating with the planet, gravity plus the centrifugal and Coriolis pseudo-forces balance exactly at five points. L4 and L5 are stable for any planet/star mass ratio below about 0.0385 (Routh's criterion), so asteroids nudged away from them curve back instead of drifting off — producing bounded tadpole or horseshoe orbits instead of escape.
Drag to orbit the camera and scroll to zoom. Adjust the mass-ratio slider (or use the planet presets) to see the Trojan cloud shrink or destabilize, click any asteroid to select it, then use the radial/tangential nudge sliders to test whether it stays trapped or escapes.
Jupiter hosts over 13,000 known Trojans split into a "Greek camp" at L4 and a "Trojan camp" at L5, but Earth, Mars and Neptune have confirmed Trojans too — Earth's first, 2010 TK7, wasn't found until 2010.