Orbital Math from Live Constants
The useful orbital numbers are already in /sim. Read them from the current parent, once, and leave
the old 9.8 habit on the launchpad.
For an orbit with centre-to-vessel radius , circular speed is . Here,
mu is m³/s², radius is metres, and an apoapsis or periapsis is an altitude above the surface.
parent=$(cat /sim/vessels/active/parent)mu=$(cat "/sim/bodies/$parent/mu")radius=$(cat "/sim/bodies/$parent/radius")altitude=120000awk "BEGIN { r=$radius + $altitude; print sqrt($mu / r) \" m/s\" }"
cat /sim/vessels/active/orbit/apoapsiscat /sim/vessels/active/orbit/periapsiscat /sim/vessels/active/orbit/periodparent=$(curl -s http://127.0.0.1:4242/v1/vessels/active/telemetry | jq -r .parent)curl "http://127.0.0.1:4242/v1/bodies/$parent" | jq '{mu, mean_radius, soi_meters}'curl http://127.0.0.1:4242/v1/vessels/active/telemetry | jq '.orbit'The vis-viva equation is . Use metres and seconds throughout. Angles from
the orbit files are degrees, so convert before feeding them to sin or cos.
Next: turn a future UT and a CCI Δv into a scheduled burn.
Next: Schedule a burnHand an impulsive maneuver to KSA's flight computer.