Gravity Assist Flyby: Hyperbolic Trajectory Lab (2D)
2D companion to the Gravity Assist Lab: a real hyperbolic two-body flyby, solved with the vis-viva and patched-conic equations, computes periapsis, deflection angle and heliocentric speed change live.
The 3D original animates a spacecraft swinging past a planet with a visually fitted bend in its path. This 2D companion replaces that fit with the actual closed-form solution of the hyperbolic two-body problem: given the planet's real gravitational parameter μ, your chosen inbound speed v∞ and flyby altitude, it derives the orbit's eccentricity, periapsis and turning angle directly from the vis-viva and Kepler orbit equations, then applies the textbook patched-conic method — adding the planet's own heliocentric velocity to the spacecraft's v∞ vector before and after the bend — to show the real Sun-frame speed gain or loss a gravity assist produces.
Exact hyperbolic orbit: a=−μ/v∞², e=1+rp·v∞²/μ, p=rp(1+e), r(ν)=p/(1+e·cosν), turning angle δ=2·arcsin(1/e). The craft advances along the path via Kepler's second law (dν/dt ∝ 1/r²), so it speeds up near periapsis exactly as a real flyby does. Heliocentric Δv comes from patched-conic vector addition of the planet's real orbital speed with the inbound/outbound v∞ vectors, rotated by δ.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install