theta = lon2 - lon1The resulting distance is in kilometers.
dist = acos(sin(lat1) × sin(lat2) + cos(lat1) × cos(lat2) × cos(theta))
if (dist < 0) dist = dist + pi
dist = dist × 6371.2
(The original Great Circle Mapper used a modified version of the geod program from the PROJ.4 cartography tools. This program uses an older, less-sophisticated algorithm developed by Paul Thomas of the USGS.)
First, in the example the locations for LAX and JFK are rounded to the nearest arc-minute of longitude and latitude, or 1/60th of a degree. The Great Circle Mapper uses data from the FAA which is accurate to 0.000001 degree.
Second, the formulae used in the example assume that Earth is a sphere.
Information on this site may not be accurate or current and is not valid for flight planning or navigation. No warranty of fitness for any purpose is made or implied. Flight planning and navigation should only be done using official charts.
Copyright © 1996-2016
Karl L. Swartz.
All rights reserved.