Escape velocity and gravity well simulator. A projectile is launched from the surface of the Moon, Earth or Jupiter at an adjustable angle above the local horizontal and an adjustable speed. The motion is integrated with a fourth-order Runge-Kutta (RK4) solver under full two-dimensional Newtonian gravity, a = -GM/r^3 times the position vector, so the trajectory curves correctly whether the projectile falls back, follows a bound elliptical arc, or escapes on a parabolic or hyperbolic path. Escape velocity is v_esc = sqrt(2GM/R). A live gravity-well chart plots the potential U(r) = -GM/r against distance and marks the projectile's specific orbital energy so you can see directly whether it clears the well.
This simulation launches a projectile from the surface of a chosen world and integrates its motion under full two-dimensional Newtonian gravity — no shortcut that treats the ground as flat or gravity as constant. At every instant the acceleration is a = −GM/r³ · r, a vector that always points from the projectile straight back to the planet's centre and whose magnitude falls off with the square of the distance. Because the projectile can move both outward and sideways, this single vector equation, integrated with a fourth-order Runge-Kutta (RK4) scheme on the state [x, y, vx, vy], is enough to reproduce every regime of orbital motion: falling back, swinging around in an ellipse, or sailing away for good. The escape velocity itself falls straight out of energy conservation. The specific orbital energy ε = v²/2 − GM/r is conserved throughout the flight (gravity does no work perpendicular to itself and there is no drag), so a projectile leaving the surface at r = R with speed v has ε = v²/2 − GM/R. Setting ε = 0 — the threshold at which the projectile can just barely coast to r → ∞ with zero speed left over — and solving for v gives vesc = √(2GM/R). Reach that speed or more and no amount of additional flight time will pull the object back.
The value −GM/r is the planet's gravitational potential energy per unit mass, and plotting it against distance from the centre produces the classic "gravity well" curve: infinitely deep at the centre, rising smoothly toward zero as r grows without bound. A projectile's total specific energy is a single horizontal line on that same chart. If the line sits below zero (ε < 0), the orbit is bound — an ellipse whose farthest point (apoapsis) is exactly where the potential curve crosses the energy line, and since a projectile launched outward from the surface generally has a periapsis smaller than the planet's radius, it swings back around and strikes the surface again rather than settling into a stable orbit. If the line sits exactly on zero (ε = 0), the trajectory is a parabola — the marginal, always-escaping-but-never-quite-getting-there case. If the line lies above zero (ε > 0), the path is a hyperbola: the projectile escapes with leftover speed at infinity, v∞ = √(2ε), never to return. Because the Moon, Earth and Jupiter differ enormously in mass and radius, the same launch speed can mean three completely different fates depending which body you pick — which is exactly what the planet buttons let you explore.
What does this simulation show?
A projectile launched from the surface of the Moon, Earth or Jupiter, moving under real Newtonian gravity that weakens with the square of distance rather than the constant "g" used in ground-level physics. Depending on your launch speed and angle, the trajectory bends into a bound ellipse that falls back to the surface, a marginal parabola, or an unbound hyperbola that escapes forever. The inset gravity-well chart shows the same outcome as a potential-energy curve with your total energy drawn as a horizontal line.
What is escape velocity, exactly?
It is the minimum surface launch speed for which the specific orbital energy ε = v²/2 − GM/R is exactly zero. Below that speed the projectile is gravitationally bound and eventually returns; at or above it, it can coast outward forever, slowing but never quite stopping. Solving ε = 0 for v gives vesc = √(2GM/R), which the simulator displays live for whichever planet you select.
Why is Jupiter's escape velocity so much higher than the Moon's?
Escape velocity scales as the square root of mass divided by radius. Jupiter is about 25,800 times more massive than the Moon but only around 40 times larger in radius, so the mass term overwhelms the radius term and its escape velocity comes out near 59.5 km/s versus the Moon's roughly 2.4 km/s — a difference of about 25 times, easily confirmed by switching planets in the simulator.
The planet buttons set the mass M and radius R used in every calculation (Moon, Earth or Jupiter). The launch-angle slider sets the direction of the initial velocity, from 0° (straight along the local horizontal, tangential to the surface) to 90° (straight up, purely radial). The launch-speed slider sets the initial speed in m/s, with its range automatically rescaled around each planet's escape velocity so you can explore comfortably below, near, and above it. The Relaunch button restarts the animation from the surface with the current settings.
It advances the state vector [x, y, vx, vy] with a fourth-order Runge-Kutta (RK4) integrator, which evaluates the acceleration a = −GM/r³ · (x, y) at four trial points per step and combines them into a weighted average — far more accurate than a simple Euler step for curved orbital paths. The time step is scaled to each planet's own characteristic orbital timescale, √(R³/GM), so the Moon and Jupiter both animate smoothly despite their vastly different real-world timescales.
Specific orbital energy is ε = v²/2 − GM/r, the sum of kinetic and gravitational potential energy per unit mass, and it stays constant throughout an unpowered, drag-free flight. A negative ε means the orbit is bound (elliptical) — the projectile will eventually be pulled back to a maximum distance and return. A value of essentially zero means a parabolic, marginally escaping path. A positive ε means a hyperbolic, permanently unbound trajectory that still has speed left over even at infinite distance.
A gravity well is the shape of the potential energy curve U(r) = −GM/r plotted against distance from the planet's centre: an infinitely deep funnel near r = R that flattens out toward zero as r grows. The inset chart draws that curve, marks your projectile's current position on it, and overlays a dashed horizontal line at its total specific energy. If that line eventually clears the curve as r increases (energy ≥ 0), the object escapes; if the line crosses back below the curve at some finite radius (energy < 0), that crossing point is the orbit's turning point, and the object is trapped inside the well.
A purely radial launch has zero angular momentum about the planet's centre, and angular momentum is conserved in a central gravitational field. Without any sideways motion there is no way to curve into an orbit — the object can only travel outward along the same radial line, slow down, and (if bound) fall back along that exact line. Only reaching or exceeding the escape velocity lets a straight-up launch leave for good, tracing a degenerate, zero-angular-momentum parabola or hyperbola instead of turning around.
It uses genuine two-body Newtonian gravity with the real values of G, and each planet's real mass and radius, integrated with a high-order RK4 scheme, so the qualitative and quantitative behaviour — including the exact escape-velocity threshold — is physically correct. It idealises the planet as a fixed, non-rotating point mass and ignores atmospheric drag, the gravity of the Sun or other bodies, and relativistic effects, all of which are legitimate simplifications at these scales and speeds.