declare function CalculateCircularizationDV{ parameter ap is 0, 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. }