A planet doesn't own all the space around it — the Sun's gravity always competes for the same territory. The Hill sphere is the region where the planet's own gravity dominates over the Sun's tidal pull, so a moon can stay bound to it:
r_H = a · (m / 3M)^(1/3)
a = planet's orbital distance from the Sun
m = planet mass, M = Sun's mass
This simulator does not just draw a sphere and check a formula — it numerically integrates the real restricted three-body problem with a 4th-order Runge-Kutta method: the moon feels genuine Newtonian gravity from both the Sun and the planet every step, while the planet follows its own unperturbed Keplerian orbit. Position and velocity are advanced with:
a_moon = -GM_sun · r/|r|³ − GM_planet · (r−R_planet)/|r−R_planet|³
Push the speed slider well above 1.0× and the moon can be flung past the Hill boundary, where the Sun's tidal stretching wins and it drifts away for good — an escape you can watch happen, not just predict. One extra real effect worth trying: flip between prograde and retrograde. Numerical studies (Hamilton & Burns, 1992) show retrograde moons stay bound out to roughly twice the distance of prograde ones, because a retrograde orbit fights the Sun's tidal torque instead of resonating with it — you can reproduce that asymmetry yourself by comparing how far out each direction survives.
- Planet — sets the mass ratio m/M that drives r_H.
- Distance from Sun — r_H grows linearly with a, so the same planet has a bigger gravitational reach farther out.
- Start distance / Orbital speed — the moon's initial condition, in Hill-radius units and multiples of the local circular velocity.
- Prograde / Retrograde — direction of the moon's orbit around the planet relative to the planet's own orbit around the Sun.