PPRuNe Forums - View Single Post - Distance calculation (lats and longs)
View Single Post
Old 17th Oct 2001, 06:50
  #3 (permalink)  
Checkboard
 
Join Date: Aug 1998
Location: Ex-pat Aussie in the UK
Posts: 5,815
Received 143 Likes on 71 Posts
Post

.. or grit your teeth, and have a look at Ed Williams's Aviation Formulary V1.31
Some great circle formulae:

Distance between points

The great circle distance d between two points with coordinates {lat1,lon1} and {lat2,lon2} is given by:

d=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2))

A mathematically equivalent formula, which is less subject to rounding error for short distances is:

d=2*asin(sqrt((sin((lat1-lat2)/2))^2 + cos(lat1)*cos(lat2)*(sin((lon1-lon2)/2))^2))
[ 17 October 2001: Message edited by: Checkboard ]
Checkboard is online now