Great Circle Calculations, Mike - K8LH
Here are the formulas I use to convert "From" and "To" coordinates into Direct (Short Path) and Reverse (Long Path) Heading and Distance data in my Amateur Logbook database program… The Excel formulas are much simpler than the Alternate formulas but I had to create the Alternative formulas because my database program does not include the ATAN2 and ACOS functions found in Excel...
Convert the decimal Latitude and Longitude values from degrees to radians (Southern Latitudes and Western Longitudes are negative numbers)
FLat = FLat_dec * PI() / 180 {From_Latitude}
FLon = FLon_dec * PI() / 180 {From_Longitude}
TLat = TLat-dec * PI() / 180 {To_Latitude}
TLon = TLon_dec * PI() / 180 {To_Longitude}
Calculating Distance - the Excel and Alternate Formulas (output is Nautical Miles)
Distance = +(ACOS(COS(FLat)*COS(TLat)*COS(FLon-TLon)+SIN(FLat)*SIN(TLat))*60)*180/PI()
The Excel formula above is pretty simple and elegant but my database doesn't have an ACOS function so here's a reasonably equivalent alternate; ACOS(X)=ATAN(SQRT((1-X)*(1+X))/X)
X = COS(FLat)*COS(TLat)*COS(FLon-TLon)+SIN(FLat)*SIN(TLat)
Distance = IF (X = -1, 10800,
IF(X = 1, 0,
MOD(10800 + (ATAN(SQRT((1-X)*(1+X))/X))*60*180/PI(),10800)
)
)