Britannica Sources used in this answer

How does the Pythagorean theorem lead to the distance formula?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In Euclidean geometry, the distance formula is derived directly from the Pythagorean theorem, which states that for any right triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides (a2+b2=c2).123

To find the distance between two points, such as (a,b) and (c,d) on a Cartesian coordinate system, you can construct a right triangle by identifying a third point at (c,b). The horizontal leg of this triangle has a length equal to the difference between the x-coordinates (|a−c|), and the vertical leg has a length equal to the difference between the y-coordinates (|b−d|).1

By applying the Pythagorean theorem, the square of the distance (the hypotenuse) is the sum of the squares of these legs:
distance2=(a−c)2+(b−d)2
Taking the square root of both sides yields the standard distance formula:
distance=(a−c)2+(b−d)2
This logic extends to three-dimensional space by including the difference between the z-coordinates.41