Files
kOS/library/lib_orbits.ks
T

27 lines
503 B
Plaintext

declare function CreateDeorbit{
parameter target.
parameter dv is 300.
parameter offsetX is 0.0.
parameter offsetZ is 0.0.
}
declare function CalculateCircularizationDV{
parameter ap is 0.
parameter sma is 0.
local mu is body:mu.
if ap = 0 {
set ap to apoapsis.
}
if sma = 0 {
set sma to orbit:semimajoraxis.
}
local apR is ap + body:radius.
local circVel is sqrt(mu / apR).
local apVel is sqrt(mu * ((2 / apR) - (1 / sma))).
return circVel - apVel.
}