??? 06/14/06 10:42 Modified: 06/14/06 10:49 Read: times |
#118270 - haversine formula Responding to: ???'s previous message |
If you assume that the Earth is spherical which it is for all practical purposes then you can use the Haversine formula
Given the the earths radius R is approximatly 6,371 Kms deltaLat = lat2-lat1 deltaLong = long2-long1 a = sin²(deltaLat/2) + cos(lat1)cos(lat2)sin²(deltaLong/2) c = 2atan2(√a, √(1−a)) great Circle distance is R*c So that will give the distance as the crow flies between two points assuming that crows fly in straight lines. you can also use the spherical law of cosines but its not very good for small distances. |