38 lines
855 B
Plaintext
38 lines
855 B
Plaintext
//-126
|
|
function DeOrbit{
|
|
parameter burnLng, deltaV.
|
|
|
|
lock pos to SHIP:geoposition.
|
|
|
|
lock curLng to pos:lng.
|
|
|
|
DECLARE LOCAL tgtLng IS burnLng - 5.
|
|
if curLng > burnLng or curLng < tgtLng {
|
|
SET WARPMODE TO "RAILS".
|
|
SET WARP TO 3.
|
|
print "warping to " + tgtLng.
|
|
WAIT UNTIL curLng > tgtLng and curLng < burnLng.
|
|
SET WARP TO 0.
|
|
print "arived at dst " + tgtLng.
|
|
print "burn at " + burnLng.
|
|
}
|
|
print "currently at" + curLng.
|
|
|
|
BRAKES ON.
|
|
RCS ON.
|
|
LOCK steering to retrograde.
|
|
wait until curLng >= burnLng.
|
|
|
|
}
|
|
|
|
function CalculateBurnDuration{
|
|
parameter dv.
|
|
|
|
// declare local isp is GetIsp().
|
|
// declare local finalMass is mass * exp(-dv / (isp * constant:g0)).
|
|
// declare local twr is ship:maxThrust / (((mass + finalMass)/2) * constant:g0).
|
|
|
|
|
|
// local t is dv / (twr * constant.g0).
|
|
// return t.
|
|
} |