Airports MS Access Database | Buy it for $39.95 |
Airports MS SQL Server Database | Buy it for $39.95 |
Airports MySQL Server Database | Buy it for $39.95 |
d = square root((X2 - X1)^2 + (Y2 - Y1)^2)
Computationally, it is a little more expensive than the Pythagorean Theorem but it gives smaller maximum errors for higher latitudes and greater distances.
a = pi/2 - lat1
b = pi/2 - lat2
c = square root( a^2 + b^2 - 2 * a * b * cosine(lon2 - lon1) )
d = R * c
where
R = 6371 km - 3960 miles (Earth radius)
pi = 3.14159... (mathematical constant)
Assuming a spherical Earth with radius R, and the locations of the two points in spherical coordinates:
dlon = lon2 - lon1
dlat = lat2 - lat1
a = (sin(dlat/2))^2 + cos(lat1) * cos(lat2) * (sin(dlon/2))^2
c = 2 * atan2( sqrt(a), sqrt(1-a) )
d = R * c
where
R = 6371 km - 3960 miles (Earth radius)
pi = 3.14159... (mathematical constant)
a = sin(lat1) * sin(lat2)
b = cos(lat1) * cos(lat2) * cos(lon2 - lon1)
c = arccos(a + b)
d = R * c
where
R = 6371 km - 3960 miles (Earth radius)
pi = 3.14159... (mathematical constant)
There is no formula to calculate the driving distance between two locations. Some companies like Falcon Solution are developing some modules which saved distances between zip codes - like a graph. The graph is then parsed.