To get a bearing (positive angle east of north) between two lat-long points, use:
bearing=mod(atan2(sin(lon2-lon1)*cos(lat2),(lat1)*sin(lat2)-sin(lat1)*cos(lat2)*cos(lon2-lon1)),2*pi)
Note - angles should probably be in radians depending on your math package.
But for small distances, you can simply calculate how many meters in one degree lat and long in your position, and then consider them as flat X, Y coordinates.
For typical 45-degree latitudes, this is about 111.122 km / degree lat, 78.847 km / degree bosom.
source
share