# Calculating Distance between Two Locations?

• 2008-07-03, 04:14
lol_breaker
Calculating Distance between Two Locations?
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 :)
• 2008-07-03, 05:53
Den123
Re: Calculating Distance between Two Locations?
Class TLocality contains method [I]Distance [/I]for calculating distance between two landmarks.

Or You can calculate distance via Haversinus (half the versed sine) formula:
[url]http://wiki.forum.nokia.com/index.php/How_to_calculate_distance_between_two_landmarks[/url]
• 2008-07-08, 21:33
genoulcha
Re: Calculating Distance between Two Locations?
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

[B]S[/B] is the arc linking the two points. The secound step is multiply this value by 6378,1km (the aproximated radius of the Earth).
• 2008-07-09, 08:38
Den123
Re: Calculating Distance between Two Locations?
Hi genoulcha, Welcome to Dibo !

Your approach is correct only if distance between the points short.