sumguytwitches

Approach in half orbit

Nov 2nd, 2020 (edited)
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add node(time:seconds + eta:apoapsis, 0, 0, 0).
  2.  
  3. lock rt to time:seconds + nextnode:eta + nextnode:orbit:period / 2.
  4. lock dist to (positionat(ship, rt) - positionat(target, rt)):mag.
  5.  
  6. function increment {parameter step. parameter type is "e".
  7. if type = "e" set nextnode:eta to nextnode:eta + step.
  8. if type = "p" set nextnode:prograde to nextnode:prograde + step.
  9. if type = "n" set nextnode:normal to nextnode:normal + step.
  10. if type = "ro" set nextnode:radialout to nextnode:radialout + step.
  11. }
  12. function adjust {
  13. parameter type is "e".
  14. set lastdist to dist. until lastdist < dist { set lastdist to dist. increment(step, type). wait 0. print dist. }.
  15. }
  16. function tweak {
  17. parameter type is "e".
  18. adjust(type).
  19. set step to -step/2.
  20. adjust(type).
  21. increment(-step, type).
  22. print dist.
  23. }
  24. set step to 1.
  25. tweak("p").
  26.  
Add Comment
Please, Sign In to add comment