Consider a right-angle triangle with side lengths as indicated:
The lengths a and b are called the side lengths, and c is called the (length of the) hypotenuse. The Pythagorean theorem says that these are related by the equation
a2+b2=c2.
This can be visualized in terms of the areas formed by squares drawn on the sides of the triangle:
If v=(x,y) is a vector in R2, the Pythagorean theorem implies that the length of v is
x2+y2.
Similarly, if A=⟨x1,y1⟩ and B=⟨x2,y2⟩ are points in A2, the Pythagorean theorem tells us that the distance between these is
(x1−x2)2+(y1−y2)2
How can we extend this to higher dimensions? That is, if A=⟨x1,y1,z2⟩ and B=⟨x2,y2,z2⟩ are points in A3, what is d(A,B)? Writing A−B=v=(x,y,z), this is the same as asking for the length of v.
A naive guess is that the length of v=(x,y,z) might be
3x3+y3+z3.
But this can't be true, since the length of (x,y,0) should be the same as the length of (x,y). That is, the appearance of the number 2 in the Pythagorean theorem isn't related to the problem being in two dimensions.
Instead, we can introduce the point
C=⟨x2,y2,z1⟩,
which has 1 component in common with A and 2 components in common with B. The points A,B, and C lie in a common plane, and we can apply the "2d" Pythagorean theorem within this plane to get d(A,B) in terms of d(A,C) and d(B,C). The vertical distance d(B,C) is just ∣z2−z1∣, and we can compute d(A,C) by the "2d" Pythagorean theorem. This is illustrated in the animation below.