Advertisement
Guest User

inclination.ks

a guest
Jan 23rd, 2016
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. //Adds a node to change inclination at equatorial ascending node.
  2. declare parameter desired_i.
  3. clearscreen.
  4. function time_to_node {
  5.  
  6. local w is ship:orbit:period/360.//calculates ship's speed in seconds per degree.
  7. local shiptolan is 360 - (orbit:argumentofperiapsis + orbit:trueanomaly).//returns number of degrees to lan.
  8. if shiptolan < 0 {
  9. set shiptolan to shiptolan + 360.
  10. }
  11.  
  12. return shiptolan * w.
  13. }
  14. function dV {
  15.  
  16. local delta_i is desired_i - orbit:inclination.
  17. local v is velocityat(ship,time:seconds + time_to_node()):orbit:mag.
  18.  
  19. return 2 * v * sin(delta_i/2).
  20. }
  21. set mnv to node(time:seconds + time_to_node(),0,dV(),0).
  22. add mnv.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement