From the Pythagorean theorem to distances anywhere in space
A right triangle has legs $a = 3$ and $b = 4$. What is the length of the hypotenuse $c$?
$c = 5$
A right triangle has legs $a = 5$ and $b = 12$. Find $c$.
$c = 13$
A right triangle has legs $a = 6$ and $b = 8$. Find $c$.
$c = 10$
$(6,8,10)$ is just $(3,4,5)$ scaled by 2. Scaling all sides by the same factor preserves the right angle — and scales the hypotenuse by the same factor.
A right triangle has two equal legs $a = b = 1$ (this is the diagonal of a unit square). Find $c$.
$c = \sqrt{2} \approx 1.414$
$\sqrt{2}$ is irrational — it cannot be written as a fraction. But it is a perfectly exact answer. We will meet it again in Section B.
A right triangle has legs $a = 8$ and $b = 15$. Find $c$.
$c = 17$
$(8,15,17)$ is another whole-number Pythagorean triple.
A right triangle has legs $a = 2$ and $b = 3$. Find $c$.
$c = \sqrt{13}$
A right triangle has legs of length $a$ and $b$. Write a single formula for the hypotenuse $c$ in terms of $a$ and $b$.
$$c = \sqrt{a^2 + b^2}$$
This compact formula is the key to Section B and C. Keep it in mind — you will rediscover it from coordinates.
Find the distance between $A = (0, 0)$ and $B = (3, 4)$.
$d = 5$
Same as exercise A1 — the two legs are the legs of a right triangle.
Find the distance between $A = (0, 0)$ and $B = (5, 0)$. (The two points lie on the same horizontal line.)
$d = 5$
When the two points share a $y$-coordinate, the "distance" is just $|\Delta x|$. No triangle needed — the right triangle degenerates to a flat line.
Find the distance between $A = (0, 0)$ and $B = (0, 4)$. (The two points lie on the same vertical line.)
$d = 4$
Find the distance between $A = (1, 2)$ and $B = (4, 6)$.
$d = 5$
Same right triangle as B1 and A1 — just shifted on the grid. Shifting doesn't change distances.
Find the distance between $A = (0, 0)$ and $B = (1, 1)$.
$d = \sqrt{2} \approx 1.414$
Same answer as exercise A4. A unit-square diagonal has length $\sqrt{2}$.
Find the distance between $A = (-3, 1)$ and $B = (1, 4)$.
$d = 5$
Negative coordinates are fine. The legs $\Delta x$ and $\Delta y$ can be positive or negative, but you square them — so the sign disappears.
Find the distance between $A = (-2, -3)$ and $B = (4, 5)$.
$d = 10$
Triangle $(6, 8, 10)$ — the $3{-}4{-}5$ triple scaled by 2.
Find the distance between $A = (4, 1)$ and $B = (-1, 5)$.
$d = \sqrt{41} \approx 6.40$
$(-5)^2 = 25$, same as $5^2 = 25$. Squaring kills the sign. Distance is always non-negative, so this always works.
Find the distance between $A = (2, 3)$ and $B = (7, 15)$.
$d = 13$
The $(5, 12, 13)$ triple again — same as exercise A2.
Let $A = (x_1, y_1)$ and $B = (x_2, y_2)$ be any two points in the plane. Derive a formula for the distance $d = AB$ using the approach from this section.
$$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$
This is the distance formula in 2D. You have just derived it from first principles using only the Pythagorean theorem.
You don't have to use the floor — any pair of axes works first. The result is always the same.
Find the distance between $A = (0, 0, 0)$ and $B = (5, 0, 0)$. $B$ lies on the $x$-axis.
$d = 5$
Along a single axis, 3D distance reduces to the ordinary 1D distance.
Find the distance between $A = (0, 0, 0)$ and $B = (3, 4, 0)$. Both points lie in the $z = 0$ plane.
$d = 5$
Setting one coordinate to zero recovers the 2D case. 3D distance is a genuine extension of 2D distance.
Find the distance between $A = (0, 0, 0)$ and $B = (0, 3, 4)$. Both points lie in the $x = 0$ plane.
$d = 5$
Find the distance between opposite corners of a unit cube: from $A = (0, 0, 0)$ to $B = (1, 1, 1)$.
$d = \sqrt{3} \approx 1.732$
The main diagonal of a unit cube has length $\sqrt{3}$. You can also see this directly: $\sqrt{1^2+1^2+1^2} = \sqrt{3}$.
Find the distance between $A = (1, 2, 3)$ and $B = (4, 6, 3)$. Notice that both $z$-coordinates are equal.
$d = 5$
Find the distance between $A = (0, 0, 0)$ and $B = (2, 2, 1)$.
$d = 3$
$(2,2,1,3)$ is a 3D Pythagorean quadruple: $2^2+2^2+1^2=3^2$.
Find the distance between $A = (0, 0, 0)$ and $B = (3, 12, 4)$. Try the two-step approach shown in the diagram at the top of this section.
$d = 13$
The $3{-}4{-}5$ triple on the floor, then the $5{-}12{-}13$ triple going up. Two Pythagorean triples nested inside each other!
Find the distance between $A = (0, 0, 0)$ and $B = (2, 6, 9)$.
$d = 11$
Another 3D quadruple: $2^2 + 6^2 + 9^2 = 11^2$.
Find the distance between $A = (1, 2, 3)$ and $B = (4, 6, 7)$. All three coordinates differ.
$d = \sqrt{41} \approx 6.40$
Let $A = (x_1, y_1, z_1)$ and $B = (x_2, y_2, z_2)$ be any two points in 3D space. Using the two-step approach — floor diagonal then height — derive a formula for the distance $d = AB$.
$$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$$
The 3D distance formula is a natural extension of the 2D one: add one more squared difference under the root. The same idea extends to 4D, 5D, or any number of dimensions — just keep adding terms.