Finding distances using latitude and longitude

by John on September 11, 2008

I posted a page this evening that lets you calculate the distance between two locations using their latitudes and longitudes. I’ve had to do this calculation once in a while and thought I’d make it available online for anyone else who needed to do the same. There is one page providing an online calculator and another page giving the formula used to calculate the distances and its derivation.

This project was prompted by a friend asking me how far my home is from Galveston where the hurricane is supposed to make landfall this weekend. Since we live northwest of Houston, we’re pretty far inland.

Related posts:

What is the shape of the earth?
Spherical trigonometry

{ 1 comment… read it below or add one }

1

Walt Roscello 01.29.10 at 11:30

A useful calculation. Note that for distances below about 10 miles, you should use an expansion of arccos around 1, since the arccos loses precison. At that distance, though, you might as well just use pythagoras and delta_long * cos(avg_lat).

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>