Tech Support > Computers & Technology > Programming > Re: Geographic algorithms
Re: Geographic algorithms
Posted by Vlad Tepes on June 27th, 2003


Enigma <kajolishot@hotmail.com> wrote:
Use your algorithm to get this right, but if the towns are close,
a rough approximation might suffice:

360 degrees =~ 40 000 km => 1 degree = 111 km
1 minute = 1.85 km
1 second = 31 m

Calculate the difference in distance (d) in latitute (y) and longitude
(x) and use the pythagorean (d*d = x*x + y*y) to calculate the distance
between the two towns.

Or, you could use this to compare lat/longitude between towns and
eliminate calculating the expensive great circle distance for towns that
clearly would be too far away.

--
Vlad


Similar Posts