Tricks and Tips - griderd/Jebnix GitHub Wiki

Getting the vector from a vessel to a body at a specific time

Let's say you want a vector from your vessel to a specific body, at some specific point in the future. For example, from your craft to the Mun, 10 minutes from now.

set v to bodies:mun:positionattime(time + 600).
set u to ship:positionattime(time + 600).
set w to u - v.
// w is your vector

lock steering to w.
wait 600.
// your vessel should now point directly at the body