Wikipedia:Reference desk/Archives/Mathematics/2007 December 8

= December 8 =

Shortest distance between two points on the globe
Hi - was wondering if anyone could point me to how I might be able to work out the distance between two points on the globe (going through the Earth's crust) given longitude and latitude? I was previously under the impression that this was termed "straight-line distance", but have also seen "straight-line distance" used to refer to distance "as the crow flies", which is not what I'm after. Would really appreciate it if someone could clear things up... thanks in advance! --220.246.244.132 (talk) 09:06, 8 December 2007 (UTC)


 * Well, if you can translate the spherical polar coordinates (ρ = Earth's radius; θ = longitude east, or (360 − longitude west); φ = (90 − latitude North), or (90 + latitude south)) into rectangular coordinates, then you can apply the usual distance formula. Does that help? -GTBacchus(talk) 10:05, 8 December 2007 (UTC)
 * The closest distance between two points on a sphere is the great-circle distance. That article has formulas for computing it. --Spoon! (talk) 10:52, 8 December 2007 (UTC)
 * No, the great circle distance is across the surface, not through the crust. :) kmccoy (talk) 11:25, 8 December 2007 (UTC)


 * Change from spherical polars into cartesian by $$x = r\cos\phi\sin\theta,\; y = r\cos\phi\cos\theta,\; z = r\sin\phi$$, where θ is the longitude and Φ the latitude, then use pythagoras: $$d = \sqrt{(\delta x)^2 + (\delta y)^2 + (\delta z)^2} = r\sqrt{2 - 2\sin\phi_1\sin\phi_2 - 2\cos\phi_1\cos\phi_2\cos\left(\delta\theta\right)}$$. mattbuck (talk) 17:40, 8 December 2007 (UTC)


 * No-one has asked how accurate you want the results. Are you willing to treat the earth as a perfect ball? If so, Mattbuck's formulae should work. How about a perfect ellipsoid? I haven't thought it through but it may just require using 3 different r's. Do you want to take local changes of altitude into account? Then it could get more complicated, but not too much if you also know those for every point. -- Meni Rosenfeld (talk) 17:16, 8 December 2007 (UTC)
 * It's not that simple; in the ellipsoid model, latitude (in the most commonly used form) is defined by the angle between the normal to the surface of the ellipsoid and the equatorial plane. --Lambiam 04:25, 10 December 2007 (UTC)


 * In the case of our planet, two ratii will suffice, as reference ellipsoids for the Earth are ellipsoids of revolution. That is not the case for less round celestial objects. Pallida  Mors  23:12, 8 December 2007 (UTC)


 * &lt;pedantry field=Latin&gt; rationes (third declension), not ratii (second). &lt;/pedantry&gt; &mdash;Tamfang (talk) 00:23, 30 December 2007 (UTC)
 * Or did you mean two radii? —Tamfang (talk) 02:06, 18 May 2023 (UTC)