What is the shortest path between two points on Earth's surface?

Two points $A$ and $B$ on the surface of the Earth have the following latitude and longitude co-ordinates:

A: $30^\circ$ N , $45^\circ$ E

B: $30^\circ$ N , $135^\circ$ W

If $R$ is the radius of the Earth, what is the length of the shortest path from $A$ and $B$?

• This question was in "general aptitude" section. Is there is a simple way to calculate? I am wondering how a "maths student" can answer this question? Commented Feb 10, 2016 at 14:14
• It was asked before here....: stackoverflow.com/questions/365826/… Edit: Besides the obvious answer that the shortest distance is a straight line. :) (couldn't resist)
– user5445
Commented Feb 10, 2016 at 16:30
• You could transform the locations to spherical coordinates, then solve for the distance. Commented Feb 11, 2016 at 2:12
• Its called the great-circle distance, of which the haversine distance or the cosine formula are approximations. Commented Jul 19, 2023 at 8:20
• The Great Circle is used by the airlines and the military Commented Jul 21, 2023 at 23:42

If you don't want to do the calculation yourself, you can use an online calculator like the one provided by NOAA.

Alternatively, if you do want to do the calculation yourself you can use the haversine formula.

This uses the ‘haversine’ formula to calculate the great-circle distance between two points – that is, the shortest distance over the earth’s surface – giving an ‘as-the-crow-flies’ distance between the points (ignoring any hills they fly over, of course!).

$$a = \sin^2\left(\frac{\Delta\phi}{2}\right) + \cos \phi_1 ⋅ \cos \phi_2 ⋅ \sin^2\left(\frac{\Delta\lambda}{2}\right)$$

$$c = 2 ⋅ \text{atan2}( \sqrt a, \sqrt {1−a} )$$

$$d = R ⋅ c$$

where $\phi$ is latitude, $\lambda$ is longitude, $R$ is earth’s radius (mean radius = 6,371km)

• This also ignores the earth's obliquity, right? For example, if you wanted to get from 0°E to 180°E on the equator, it would be shorter to go via the poles than via the equator, but this algorithm wouldn't tell you that. Commented Feb 11, 2016 at 0:24
• @naught101 Yes, you're correct. The haversine formula treats the earth as a sphere, not an ellipsoid. Commented Feb 11, 2016 at 18:50

45E is directly opposite 135W. It's therefore obvious (hopefully) that the shortest path is straight over the North pole (which is at 90 degrees North). The path takes us round 120 degrees of the Earth's circumference, or 1/3rd of it.

• Nice. Not a general solution but probably why it was asked using those locations. Commented Feb 11, 2016 at 2:13

This is not about the Math involved but, the Question of what really is the Shortest distance between two points on the surface of a Sphere. But,what seems to be missing when explaining this topic is. There are "two" Geodesic arcs between any two points on the surface of a Sphere both equidistant and,a mirror image of each other unless, the points are 180 degrees apart then it would be "0ne" path only over the curve. Thank You .

• Welcome Mark. Can you clarify what is meant by "two geodesic arcs between 2 points on a surface both equidistant"? Are these two arcs the same length and the shortest distance between the points? (The shortest distance is along a great circle, of which I thought there was only 1 on the surface of a sphere.) Commented Jul 18, 2023 at 16:18