The Orthodromy Formula

Definition

An orthodromic or great-circle route on the Earth’s surface is the shortest possible real way (distance) between any two points.

The Formula

Ortho(A, B) = r x acos[[cos(LatA) x cos(LatB) x cos(LongB-LongA)] + [sin(LatA) x sin(LatB)]]

Where: r is the radius of the Earth (6371 kilometers, 3959 miles).

NOTE (Geonames Database)

The Geonames lat & lon data are in Decimal Degrees (wgs84)
Decimal Degrees to Radians = RADIANS(DecimalDegrees) or DecimalDegrees * Pi/180

Sources

https://fr.wikipedia.org/wiki/Orthodromie
http://www.lion1906.com/Pages/english/orthodromy_and_co.html