Circumferential-Distance.nb

Written 27 July 2018 by Vince Cronin;  revised 1 August 2018

A code to find the circumferential distance between two points on Earth' s surface, given their geographic coordinates (latitude, longitude)

Constants

Estimates of the arithmetic mean radius of Earth are  km (Chambat and Valette, 2001) and 6371.0087714 km (Moritz, 2000).
Estimates of the mean radius of a spherical Earth with the same volume as the actual non - spherical Earth are 6371.0008 km (Chambat and Valette, 2001) and 6371.0007900 km (Moritz, 2000).  
Estimates of the mean radius of a spherical Earth with the same surface area as the actual non-spherical Earth are 6371.0072 km (Chambat and Valette, 2001) and 6371.0071810 km (Moritz, 2000).

earthMeanRadius=6371.01;

earthMeanCircumference=earthMeanRadius 2 π;

kmPerDegree=earthMeanCircumference/360;

kmPerRadian=earthMeanCircumference/(2 π);

User-Defined Function

geog2cart[lat_,long_]:={Cos[lat Degree]Cos[long Degree],Cos[lat Degree]Sin[long Degree],Sin[lat Degree]};

Input

firstPoint={23.5943,-45.0421};

secondPoint={23.3290,-43.7952};

Computation

firstPtCart=geog2cart[firstPoint[[1]],firstPoint[[2]]];

secondPtCart=geog2cart[secondPoint[[1]],secondPoint[[2]]];

distance=VectorAngle[firstPtCart,secondPtCart]*kmPerRadian;

Output

The distance between the two points, expressed in km, is ...

N[distance]

Reference

Chambat, F., and Valette, B., 2001, Mean radius, mass, and inertia for reference Earth models:  Physics of the Earth and Planetary Interiors, v. 124, p. 237-253, v. 74(1), p. 128-133.

Moritz, H., 2000, Geodetic Reference System 1980:  Journal of Geodesy, v. 74(1), p. 128-133, doi.org/10.1007/s001900050278