This is a genuine restricted two-body simulation: the spacecraft has zero mass and moves only under the central body's gravity, integrated frame by frame with a fixed-step RK4 integrator so the orbit stays a stable, closed ellipse between burns. A burn is an instantaneous velocity change applied along the current velocity direction (prograde adds speed, retrograde removes it) — exactly how the vis-viva equation says a single impulsive Δv reshapes an orbit's energy and, with it, its whole ellipse.
a = -μ / (2ε), ε = v²/2 - μ/r — vis-viva: energy sets semi-major axis
e = |((v² - μ/r)·r_vec - (r_vec·v_vec)·v_vec) / μ| — eccentricity vector
Hohmann: v_t1 = √(μ(2/r1 - 1/a_t)), Δv1 = v_t1 - v_circ(r1)
v_t2 = √(μ(2/r2 - 1/a_t)), Δv2 = v_circ(r2) - v_t2
T_transfer = π √(a_t³/μ)
- A prograde burn raises the orbit on the opposite side (apoapsis if fired near periapsis); a retrograde burn lowers it.
- The Hohmann button computes both burns analytically for the current circular radius and your chosen target radius, fires burn 1 immediately, and auto-fires burn 2 exactly at apoapsis of the transfer ellipse — the same two-impulse strategy real missions use to change orbits for the least total Δv.
- If a burn pushes total energy ε ≥ 0 the orbit becomes hyperbolic (e ≥ 1) — the ship escapes rather than looping back, exactly as vis-viva predicts.