Home▸Space & Astronomy▸Gravity Assist Flyby: Hyperbolic Trajectory Lab (2D)

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.

Space & Astronomy2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-premium-3d-gravity-assist-simulator ↗ Open standalone

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.

⚙ Under the hood

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 δ.

gravity assisthyperbolic orbitpatched conicvis-viva equationorbital mechanicskepler's laws

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install