Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 - cos(x)
- 1 - cos(x) = 2*sin(x/2)^2
- = 2*haversin(x)
- 1 - cos(x) = sin(x)^2/(1 + cos(x))
- Distance = acos(SIN(lat1)*SIN(lat2)+COS(lat1)*COS(lat2)*COS(lon2-lon1))*6371
- dLat = (lat2-lat1)
- dLon = (lon2-lon1)
- a = sin(dLat/2) * sin(dLat/2) + cos(lat1) * cos(lat2) * sin(dLon/2) * sin(dLon/2)
- distance = 6371 * 2 * atan2(sqrt(a), sqrt(1-a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement