Calculating the compass bearing