I\'m working on a "compass" for a mobile-device. I have the following points:
point 1 (current location): Latitude = 47.2246, Longitude = 8.8257
poi
I couldn't understand your solution well, calculating the slope worked for me. To modify on efwjames's and your answer. This should do -
import math
def getDegrees(lat1, lon1, lat2, lon2,head):
dLat = math.radians(lat2-lat1)
dLon = math.radians(lon2-lon1)
bearing = math.degrees(math.atan2(dLon, dLat))
return head-bearing