In the case of a general surface, the distance between two points measured along the surface is known as a geodesic. For example, the shortest distance between two points on a sphere is an arc of a great circle.
In the Euclidean plane , the curve that minimizes the distance between two points is clearly a straight line segment. This can be shown mathematically as follows using calculus of variations and the so-called Euler-Lagrange differential equation. The line element in is given by
(1)
|
so the arc length between two points and is
(2)
|
where and the quantity we are minimizing is
(3)
|
Finding the derivatives gives
(4)
| |||
(5)
|
so the Euler-Lagrange differential equation becomes
(6)
|
Integrating and rearranging,
(7)
|
(8)
|
(9)
|
(10)
|
The solution is therefore
(11)
|
which is a straight line. Now verify that the arc length is indeed the straight-line distance between the points. and are determined from
(12)
| |||
(13)
|
Solving for and gives
(14)
| |||
(15)
|
so the distance is
(16)
| |||
(17)
| |||
(18)
| |||
(19)
|
as expected.
For two points with exact trilinear coordinates and , the distance between them is
(20)
| |||
(21)
|
where is the area of the triangle (Scott 1894; Carr 1970; Kimberling 1998, p. 31).
The shortest distance between two points on a sphere is the so-called great circle distance.