A planet on a circular orbit around a fixed star is integrated with velocity-Verlet (a symplectic, energy-conserving scheme) under inverse-square gravity:
a = -GM · r / |r|³
v(t+dt) = v(t) + ½(a(t)+a(t+dt))·dt
r(t+dt) = r(t) + v(t)·dt + ½a(t)·dt²
"Kick planet" adds a velocity impulse (Δv) along the direction set by the angle slider — 0° is prograde (along the current velocity), positive angles rotate the kick outward (away from the star), negative angles rotate it inward. The resulting orbit shape is read directly from the specific orbital energy and eccentricity:
ε = v²/2 − GM/r (specific energy)
e = √(1 + 2·ε·h²/(GM)²) (eccentricity, h = |r×v|)
- e ≈ 0 — circular orbit. 0 < e < 1 — ellipse. e ≥ 1 (ε ≥ 0) — escape / hyperbolic trajectory.
- A big enough inward kick can drop the periapsis below the star's radius — stellar impact.
- The trail traces the planet's actual path so you can see the ellipse (or escape hyperbola) form in real time.