A point-mass spacecraft moves under real two-body Newtonian gravity from the chosen central body, integrated with 4th-order Runge–Kutta (RK4) at a fixed sub-step:
a_gravity = -μ · r⃗ / |r|³
a_thrust = throttle · a_max · v̂ (prograde, or -v̂ retrograde)
ε = v²/2 - μ/r (specific orbital energy)
a_sma = -μ / (2ε) (semi-major axis)
h = x·vy - y·vx (specific angular momentum)
e = √(1 + 2εh²/μ²) (eccentricity)
r_peri = a_sma·(1-e), r_apo = a_sma·(1+e)
T = 2π√(a_sma³/μ) (period, bound orbits only)
The insertion-speed slider is expressed as a multiple of the local circular velocity v_c = √(μ/r), so 1.00× always starts a circular orbit whichever body is selected. Tilting the flight-path angle away from 0° or firing the engine changes the orbital energy ε and angular momentum h, which is what actually reshapes the ellipse — the readouts below are recomputed from the live state every frame, not looked up from a table. Simulated time runs faster than real time (about a minute of orbit per few seconds of animation) so a full period is watchable; each body's clock rate is tuned so a full-throttle burn always lasts roughly the same real time.
- ε ≥ 0 — parabolic or hyperbolic trajectory: the spacecraft has reached escape velocity and will never return.
- Crash — if periapsis drops below the body's surface, the trajectory intersects the ground and the mission ends.
- Fuel — burns down while either burn button is held active, proportional to throttle; thrust stops automatically at 0%.