21 lines
481 B
Plaintext
21 lines
481 B
Plaintext
@LAZYGLOBAL OFF.
|
|
|
|
function int {
|
|
//
|
|
// Truncate or round towards zero.
|
|
//
|
|
parameter n.
|
|
|
|
if n < 0 return ceiling(n).
|
|
return floor(n).
|
|
}
|
|
|
|
|
|
function atmosphere_exit_eta {
|
|
//
|
|
// Return the number of seconds until the vessel exists the atmosphere.
|
|
//
|
|
// The vdot gives us the magnitude of the orbital velocity vector in the UP direction because UP is a unit vector
|
|
return (BODY:atm:height - ALTITUDE) / vdot(velocity:orbit, UP:vector).
|
|
}
|