Date: 6/8/96 at 18:4:20 From: Nic Preller Subject: Distance calculation If I have the co-ordinates of two places in Degrees Latitude and Longitude, how do I calculate the distance in nautical miles?
Date: 6/8/96 at 18:51:44 From: Doctor Anthony Subject: Re: Distance calculation This can be done fairly easily by using the scalar product of two vectors to find the angle between those vectors. If the vectors are OA and OB where A and B are the two points on the surface of the earth and O is the centre of the earth, the scalar product gives OA*OB*cos(AOB) = R^2*cos(AOB) where R = radius of the earth. Having found angle AOB, the distance between the points is R*(AOB) with AOB in radians. To find the scalar product we need the coordinates of the two points. Set up a three-dimensional coordinate system with the x-axis in the longitudinal plane of OA and the xy plane containing the equator, and the z-axis along the earth's axis. With this system, the coordinates of A will be Rcos(latA), 0, Rsin(latA) and the coordinates of B will be Rcos(latB)cos(lonB-lonA),Rcos(latB)sin(lonB-lonA),Rsin(latB) The scalar product is given by xA*xB + yA*yB + zA*zB = R^2cos(latA)cos(latB)cos(lonB-lonA)+ R^2sin(latA)sin(latB) Dividing out R^2 will give cos(AOB) cos(AOB)=cos(latA)cos(latB)cos(lonB-lonA)+sin(latA)sin(latB) This gives AOB, and the great circle distance between A and B will be R*(AOB) with AOB in radians. -Doctor Anthony, The Math Forum Check out our web site! http://mathforum.org/dr.math/
Search the Dr. Math Library:
Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.