Hi, Does anyone know how to calculate the distance between two geographic coordinates(longitude and latitude)? Any help at all would be GREATLY appreciated, thanks![]()
Hi, Does anyone know how to calculate the distance between two geographic coordinates(longitude and latitude)? Any help at all would be GREATLY appreciated, thanks![]()
Class TLocality contains method Distance for calculating distance between two landmarks.
Or You can calculate distance via Haversinus (half the versed sine) formula:
http://wiki.forum.nokia.com/index.ph..._two_landmarks
The calculation is a bit simple:
First, calculate the distance between the two coordinates throght the cosine law:
cos(S) = sin(l1)*sin(l2)+cos(11)*cos(l2)*cos(dl)
where:
l1 and l2 are the latitude of the points
dl is the difference between the longitude of the points
S is the arc linking the two points. The secound step is multiply this value by 6378,1km (the aproximated radius of the Earth).
Hi genoulcha, Welcome to Dibo !
Your approach is correct only if distance between the points short.