Advertisement
sumguytwitches

Time of Entering Atmosphere

Nov 3rd, 2020 (edited)
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. if not defined targetalt set targetalt to body:atm:height.
  2.  
  3. set rt to time:seconds + eta:periapsis.
  4. lock altthen to body:altitudeof(positionat(ship,rt)).
  5. set wiggle to 500.
  6. set step to orbit:period / 2.
  7. set iterations to 0.
  8. until abs(altthen -targetAlt) < wiggle {
  9. if altthen < targetAlt { set rt to rt - step. set step to step / 2. wait 0. set iterations to iterations + 1. }
  10. if altthen > targetAlt { set rt to rt + step. set step to step / 2. wait 0. set iterations to iterations + 1. }
  11. }
  12. lock rteta to rt-time:seconds.
  13. print "rt is timestamp of " + round(altthen) + " m, and rteta is the eta.".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement