Distance Formula

Geometry & Measurement

The distance formula calculates the straight-line distance between two points in the coordinate plane using the Pythagorean theorem.

Formula

d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}
Visualization

Definition

The distance formula gives the straight-line distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ on a coordinate plane: subtract the x-coordinates, subtract the y-coordinates, square both differences, add them together, and take the square root, $d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$. This is just the Pythagorean theorem in disguise, with the horizontal and vertical differences as the two legs and the distance as the hypotenuse of an invisible right triangle; the formula is symmetric, $d(A,B) = d(B,A)$, since squaring erases the sign of the subtraction. Formally, it defines the Euclidean metric on $\mathbb{R}^2$, $d(p, q) = |p - q| = \sqrt{\sum (p_i - q_i)^2}$, satisfying positivity, symmetry, and the triangle inequality, which extends to $n$ dimensions as $d(p, q) = \sqrt{\sum_{i=1}^{n} (p_i - q_i)^2}$.

Example

The distance between $(1, 2)$ and $(4, 6)$ is $d = \sqrt{(4-1)^2 + (6-2)^2} = \sqrt{9 + 16} = \sqrt{25} = 5$ units. Points $A(-3, 1)$ and $B(5, 7)$ give $d = \sqrt{(5-(-3))^2 + (7-1)^2} = \sqrt{64 + 36} = \sqrt{100} = 10$ units, and the formula can be used to verify whether three points form an isosceles or equilateral triangle, to find circle radii, and to prove geometric properties using coordinates. Alternative metrics on $\mathbb{R}^2$ include the taxicab (Manhattan) metric $d_1(p,q) = |x_2-x_1| + |y_2-y_1|$ and the Chebyshev metric $d_\infty(p,q) = \max(|x_2-x_1|, |y_2-y_1|)$, which define different "unit circles": a Euclidean circle, a taxicab diamond, and a Chebyshev square.

Key Insight

The order of subtraction never matters, since the differences are squared before being added. Metric spaces generalize the distance formula to abstract settings: Cauchy sequences, completeness, and continuity are all defined in terms of metrics, making the distance formula the concrete starting point for functional analysis and topology.