Based on the reasonably accurate assumption that Earth is a smooth sphere, the distance calculation is based on spherical trigonometry. However, there can be numerical problems with calculations if the two points are close together or near opposite poles. Vincenty's formula is used to provide accurate calculations under all conditions:
Vincenty, Thaddeus, 1975. Direct and Inverse Solutions of Geodesics on the Ellipsoid with Application of Nested Equations. Survey Review 23 (176): 88–93. Kingston Road, Tolworth, Surrey: Directorate of Overseas Surveys.
D = R•arctan(y/x), where
x = sin(λ1)•sin(λ2) + cos(λ1)•cos(λ2)•cos(ΔL)
y = sqrt[(cos(λ2)•sin(ΔL))2 + (cos(λ1)•sin(λ2) - sin(λ1)•cos(λ2)•cos(ΔL))2]
R (Earth's mean equatorial radius) = 6378 km
The answer is rounded to the nearest 0.01 km (10 m).
My thanks to James Clegg (location and affiliation unknown) who has pointed out a major problem with earlier versions of this calculation.