Distance Between Points on the Earth's Surface
Total Page:16
File Type:pdf, Size:1020Kb
Distance between Points on the Earth's Surface Abstract During a casual conversation with one of my students, he asked me how one could go about computing the distance between two points on the surface of the Earth, in terms of their respective latitudes and longitudes. This is an interesting exercise in spherical coordinates, and relates to the so-called haversine. The calculation of the distance be- tween two points on the surface of the Spherical coordinates Earth proceeds in two stages: (1) to z compute the \straight-line" Euclidean x=Rcosθcos φ distance these two points (obtained by y=Rcosθsin φ R burrowing through the Earth), and (2) z=Rsinθ to convert this distance to one mea- θ y sured along the surface of the Earth. φ Figure 1 depicts the spherical coor- dinates we shall use.1 We orient this coordinate system so that x Figure 1: Spherical Coordinates (i) The origin is at the Earth's center; (ii) The x-axis passes through the Prime Meridian (0◦ longitude); (iii) The xy-plane contains the Earth's equator (and so the positive z-axis will pass through the North Pole) Note that the angle θ is the measurement of lattitude, and the angle φ is the measurement of longitude, where 0 ≤ φ < 360◦, and −90◦ ≤ θ ≤ 90◦. Negative values of θ correspond to points in the Southern Hemisphere, and positive values of θ correspond to points in the Northern Hemisphere. When one uses spherical coordinates it is typical for the radial distance R to vary; however, in our discussion we may fix it to be the average radius of the Earth: R ≈ 6; 378 km: 1What is depicted are not the usual spherical coordinates, as the angle θ is usually measure from the \zenith", or z-axis. Thus, we assume that we are given two points P1 and P2 determined by their respective lattitude-longitude pairs: P1(θ1; φ1);P2(θ2; φ2). In cartesian coordi- nates we have P1 = P1(x1; y1; z1) and P2 = P2(x2; y2; z2), where x; y; and z are determined by the spherical coordinates through the familiar equations: x = R cos θ cos φ y = R cos θ sin φ z = R sin θ The Euclidean distance d between P1 and P2 is given by the three-dimensional Pythagorean theorem: 2 2 2 2 d = (x1 − x2) + (y1 − y2) + (z1 − z2) : The bulk of our work will be in computing this distance in terms of the spherical coordinates. Converting the cartesian coordinates to spherical coordinates, we get 2 2 2 d =R = (cos θ1 cos φ1 − cos θ2 cos φ2) 2 +(cos θ1 sin φ1 − cos θ2 sin φ2) 2 +(sin θ1 − sin θ2) 2 2 2 2 = cos θ1 cos φ1 − 2 cos θ1 cos φ1 cos θ2 cos φ2 + cos θ2 cos φ2 2 2 2 2 + cos θ1 sin φ1 − 2 cos θ1 sin φ1 cos θ2 sin φ2 + cos θ2 sin φ2 2 2 + sin θ1 − 2 sin θ1 sin θ2 + sin θ2 = 2 − 2 cos θ1 cos θ2 cos(φ1 − φ2) − 2 sin θ1 sin θ2 Next in order to compute the distance D P along the surface of the Earth, we need only 1 analyze Figure 2 in detail. Notice that D is the arc length along the indicated sector. From R d/2 d D sin(α=2) = ; 2R we get α d/2 sin α = 2 sin(α=2) cos(α=2) s 2 R d d = × 1 − R 2R P2 d p = 4R2 − d2: 2R2 Figure 2: Arc Length Therefore, in terms of d and R, the distance D is given by d p D = Rα = R sin−1 4R2 − d2 ; 2R2 which, in principle, concludes this narrative. The distance is often represented in terms of the so-called haversine function, defined by A 1 − cos A haversin A = sin2 = : 2 2 This says that cos A = 1 − 2 haversin A: Returning to the formula for d above, we continue, feeding in the new notation: 2 2 d =R = 2 − 2 cos θ1 cos θ2 cos(φ1 − φ2) − 2 sin θ1 sin θ2 = 2 − 2 cos θ1 cos θ2[1 − 2 haversin (φ1 − φ2)] − 2 sin θ1 sin θ2 = 2 − 2 cos(θ1 − θ2) + 4 cos θ1 cos θ2 haversin (φ1 − φ2) = 4 haversin (θ1 − θ2) + 4 cos θ1 cos θ2 haversin (φ1 − φ2) Which says that d 2 = haversin (θ − θ ) + cos θ cos θ haversin (φ − φ ); 2R 1 2 1 2 1 2 and so haversin α = haversin (θ1 − θ2) + cos θ1 cos θ2 haversin (φ1 − φ2); Finally, we have (refer to Figure 2) d 2 = haversin (θ −θ )+cos θ cos θ haversin (φ −φ ); sin2(α=2) = haversin α; 2R 1 2 1 2 1 2 meaning that p D = Rα = 2R sin−1 haversin α :.