Speed and direction calculations