Euclidean distance
High school
Consider two points $p = (p_1, \dots, p_n)$ and $q = (q_1, \dots, q_n)$ in $\reals^n$. The Euclidean distance between $p$ and $q$ is the length of the straight segment from $p$ to $q$:
\[d_2(p, q) = \sqrt{(p_1 - q_1)^2 + \dots + (p_n - q_n)^2}.\]
Undergraduate
Consider two points $p = (p_1, \dots, p_n)$ and $q = (q_1, \dots, q_n)$ in $\reals^n$. The Euclidean distance between $p$ and $q$ is
\[d_2(p, q) = \norm{p - q}_2\]where $\norm{\cdot}$ indicates the Euclidean norm.
Examples
Worked examples
-
The north pole $p = (0, 0, 1)$ and the point $q = (1, 0, 0)$ on the equator of the unit sphere in $\reals^3$
: $d_2(p, q) = \sqrt{1^2 + 0^2 + 1^2} = \sqrt{2} \approx 1.41$
High school
The Euclidean distance $\sqrt{2} \approx 1.41$ is shorter, because the straight segment cuts through the inside of the sphere.
-
The points $p = (0, 0)$ and $q = (100, 100)$ in $\reals^2$
: $d_2(p, q) = \sqrt{100^2 + 100^2} = 100 \sqrt{2} \approx 141.42$
High school
In the discrete metric, they are at distance $1$, the same as every two different points, so the discrete metric does not measure size at all.
-
The points $p = (0, 0)$ and $q = (2, 0)$ in $\reals^2$
: $d_2(p, q) = \sqrt{2^2 + 0^2} = 2$
High school
Only the discrete metric differs.
-
The points $p = (1, 1)$ and $q = (4, 5)$ in $\reals^2$
: $d_2(p, q) = \sqrt{3^2 + 4^2} = 5$
High school
The straight-line distance is $5$, the distance along the axes is $3 + 4 = 7$, and the larger difference is $4$. Every pair of different points is at discrete distance $1$.
Distinctions involving this term
- Types of distances: A metric measures how far apart two points are, and the same two points can be at different distances under different metrics. The Euclidean distance is the straight-line distance, the taxicab distance travels along the axes, and the Chebyshev distance takes the largest difference in one coordinate. The geodesic distance is the length of the shortest path that stays on a surface, such as the great-circle distance on the Earth. The discrete metric only says whether two points are equal.