Calculate the begining direction