2018-07-27 17:23:38 +02:00
|
|
|
@LAZYGLOBAL OFF.
|
|
|
|
|
2019-02-08 22:17:19 +01:00
|
|
|
function int {
|
|
|
|
//
|
|
|
|
// Truncate or round towards zero.
|
|
|
|
//
|
2018-07-27 17:23:38 +02:00
|
|
|
parameter n.
|
|
|
|
|
2018-08-05 19:40:16 +02:00
|
|
|
if n < 0 return ceiling(n).
|
|
|
|
return floor(n).
|
2018-07-27 17:23:38 +02:00
|
|
|
}
|
2019-02-08 22:17:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
function atmosphere_exit_eta {
|
|
|
|
//
|
|
|
|
// Return the number of seconds until the vessel exists the atmosphere.
|
|
|
|
//
|
2019-02-09 21:32:14 +01:00
|
|
|
// The vdot gives us the magnitude of the orbital velocity vector in the UP direction because UP is a unit vector
|
2019-02-08 22:17:19 +01:00
|
|
|
return (BODY:atm:height - ALTITUDE) / vdot(velocity:orbit, UP:vector).
|
|
|
|
}
|