def get_bearing(aLocation1, aLocation2):
 off_x = (aLocation2.lon - aLocation1.lon)
 off_y = (aLocation2.lat - aLocation1.lat)
 bearing = (90.0 + (math.atan2((- off_y), off_x) * 57.2957795))
 if (bearing < 0):
  bearing += 360.0
 return bearing

def get_bearing ( aLocation1 , aLocation2 ) : off_x = ( aLocation2 . lon - aLocation1 . lon ) off_y = ( aLocation2 . lat - aLocation1 . lat ) bearing = ( 90.0 + ( math . atan2 ( ( - off_y ) , off_x ) * 57.2957795 ) ) if ( bearing < 0 ) : bearing += 360.0 return bearing
returns the bearing between the two locationglobal objects passed as parameters .