TOPICS
Search

Point-Point Distance--2-Dimensional


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 R^2, 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 R^2 is given by

 ds=sqrt(dx^2+dy^2),
(1)

so the arc length between two points (x_1,y_1) and (x_2,y_2) is

 L=intds=int_(x_1)^(x_2)sqrt(1+y^'^2)dx,
(2)

where y^'=dy/dx and the quantity we are minimizing is

 f=sqrt(1+y^'^2).
(3)

Finding the derivatives gives

(partialf)/(partialy)=0
(4)
d/(dx)(partialf)/(partialy^')=d/(dx)[(1+y^'^2)^(-1/2)y^'],
(5)

so the Euler-Lagrange differential equation becomes

 (partialf)/(partialy)-d/(dx)(partialf)/(partialy^')=d/(dx)((y^')/(sqrt(1+y^'^2)))=0.
(6)

Integrating and rearranging,

 (y^')/(sqrt(1+y^'^2))=c
(7)
 y^('2)=c^2(1+y^'^2)
(8)
 y^('2)(1-c^2)=c^2
(9)
 y^'=c/(sqrt(1-c^2))=a.
(10)

The solution is therefore

 y=ax+b,
(11)

which is a straight line. Now verify that the arc length is indeed the straight-line distance between the points. a and b are determined from

y_1=ax_1+b
(12)
y_2=ax_2+b.
(13)

Solving for a and b gives

a=(y_2-y_1)/(x_2-x_1)
(14)
b=(x_1y_2-x_2y_1)/(x_1-x_2),
(15)

so the distance is

L=int_(x_1)^(x_2)sqrt(1+y^('2))dy
(16)
=(x_2-x_1)sqrt(1+a^2)
(17)
=(x_2-x_1)sqrt(1+((y_2-y_1)/(x_2-x_1))^2)
(18)
=sqrt((x_2-x_1)^2+(y_2-y_1)^2),
(19)

as expected.

For two points with exact trilinear coordinates (alpha,beta,gamma) and (alpha^',beta^',gamma^'), the distance between them is

D=(sqrt(-abc[a(beta-beta^')(gamma-gamma^')+b(gamma-gamma^')(alpha-alpha^')+c(alpha-alpha^')(beta-beta^')]))/(2Delta)
(20)
=(sqrt(abc[acosA(alpha-alpha^')^2+bcosB(beta-beta^')^2+ccosC(gamma-gamma^')^2]))/(2Delta),
(21)

where Delta 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.


See also

Geodesic, Great Circle, Line Line Picking, Point-Point Distance--3-Dimensional

Explore with Wolfram|Alpha

References

Carr, G. S. Formulas and Theorems in Pure Mathematics, 2nd ed. New York: Chelsea, 1970.Kimberling, C. "Triangle Centers and Central Triangles." Congr. Numer. 129, 1-295, 1998.Scott, C. A. Projective Methods in Plane Analytical Geometry, 3rd ed. New York: Chelsea, 1894.

Cite this as:

Weisstein, Eric W. "Point-Point Distance--2-Dimensional." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Point-PointDistance2-Dimensional.html

Subject classifications