SinnottsFormula
Calculating Distance Between Points on the Earth
A common task for GIS software is to calculate the distance between to two points on the surface of the earth. The shortest distance between these points is the great circle route that connects them. This is the trace of a plane that passes through the two points and the center of the sphere at its intersection with the surface of the sphere. Sinnott's formula is used to calculate this distance.
Sinnott's Formula
c = sin^2((lat1-lat0)/2) + cos(lat1) * cos(lat0) * sin^2((lon1-lon0)/2)
d = 2 * R * (arcsin(sqrt(c))
The variables are:
(lon0, lat0) location of the first point
(lon1, lat1) location of the second point
R is the radius of the earth
d is the distance between the points