# Euclidean distance

In mathematics, the **Euclidean distance** or **Euclidean metric** is the "ordinary" distance between two points that one would measure with a ruler, and is given by the Pythagorean formula. By using this formula as distance, Euclidean space (or even any inner product space) becomes a metric space. The associated norm is called the **Euclidean norm.** Older literature refers to the metric as **Pythagorean metric**.

## Definition

The **Euclidean distance** between points **p** and **q** is the length of the line segment . In Cartesian coordinates, if **p** = (*p*_{1}, *p*_{2},..., *p*_{n}) and **q** = (*q*_{1}, *q*_{2},..., *q*_{n}) are two points in Euclidean *n*-space, then the distance from **p** to **q** is given by:

The Euclidean norm measures the distance of a point to the origin of Euclidean space:

where the last equation involves the dot product. This is the length of **p**, when regarded as a Euclidean vector from the origin. The distance itself is given by:

### Special cases

In one dimension, the distance between two points on the real line is the absolute value of their numerical difference. Thus if *x* and *y* are two points on the real line, then the distance between them is computed as

In one dimension, there is a single homogeneous, translation-invariant metric (in other words, a distance that is induced by a norm), up to a scale factor of length, which is the Euclidean distance. In higher dimensions there are other possible norms.

In the Euclidean plane, if **p** = (*p*_{1}, *p*_{2}) and **q** = (*q*_{1}, *q*_{2}) then the distance is given by

Alternatively, it follows from () that if the polar coordinates of the point **p** are (*r*_{1}, θ_{1}) and those of **q** are (*r*_{2}, θ_{2}), then the distance between the points is

In three-dimensional Euclidean space, the distance is

and so on.

## See also

- Mahalanobis distance normalizes based on a covariance matrix to make the distance metric scale-invariant.
- Manhattan distance measures distance following only axis-aligned directions.
- Chebyshev distance measures distance assuming only the most significant dimension is relevant.
- Minkowski distance is a generalization that unifies Euclidean distance, Manhattan distance, and Chebyshev distance.
- Metric
- Pythagorean addition