A rectangular room has sides 4.2 m and 5.6 m. The shortest path between opposite corners follows its diagonal rather than two walls. We can calculate its length without measuring diagonally.

In a right triangle, the square of the hypotenuse equals the sum of the squares of the legs: a²+b²=c². Conversely, this equality for a triangle’s sides guarantees a right angle opposite c. Here a,b are the sides forming the right angle, and c is the opposite and longest side. We use similar triangles and operations with square roots.

Squared lengths have a geometric meaning

A square of side a has area a². Imagine a large square of side a+b and four identical right triangles with legs a,b. Each triangle has area ab/2, half the corresponding rectangle.

In the first diagram, the triangles leave a square of side c inside. Its angles are right angles because the original triangle’s two acute angles sum to 90°. In the second, the same four triangles are rearranged to leave squares of sides a and b. The large square and removed area are unchanged, so the remainders are equal:

(c)^(2) = (a + b)^(2) − 4(ab)/(2) = (a)^(2) + (b)^(2).

Four triangles, remainder c²

a + b = 7b = 4a = 3c² = 25

Same triangles, remainder a² + b²

a + b = 7a² = 9b² = 16

Projections and geometric mean

ABCHb = 4a = 3c = 5p = 3.2q = 1.8h = 2.4
The first two panels are 7×7 squares with a=3,b=4,c=5. Each of the four congruent triangles has area 6; remainder 25 equals 9+16. Uniform scale and exact boundaries; labels supplement colour. The third has its own scale: AC=b=4, BC=a=3, AB=c=5, AH=p=3.2, HB=q=1.8, CH=h=2.4. H is the perpendicular foot. The dashed semicircle has diameter AB and passes through C.

The picture uses a=3,b=4, but the argument works for any positive a,b: it needs only four congruent right triangles. AMSI’s dissection proof, Euclid I.47.

Find a length, not its square

The room’s diagonal is the hypotenuse:

d = √((4.2)^(2) + (5.6)^(2)) = √(49) = 7 m.

Take the positive root because a length is positive. The squared value 49 has units m²; taking its square root returns metres. If hypotenuse c and leg b are known, the other leg is a=√(c²−b²); a nondegenerate triangle requires c>b>0.

You cannot replace √(a²+b²) by a+b. In our example, the path along the walls is 9.8 m, while the diagonal is 7 m. Nor can you apply the equality because a drawn triangle looks almost right-angled: an equilateral triangle of side 2 would give the false claim 4=4+4.

Testing a right angle: the converse

If an existing triangle’s sides satisfy a²+b²=c², the angle opposite c is right. Construct a separate right triangle with legs a,b. By the theorem already proved, its hypotenuse has length c. It is congruent to the given triangle by SSS, so the corresponding angle is also 90°. This is a separate proof of the converse. Euclid I.48.

For a physical corner, compare three measured lengths against this equality; the conclusion’s accuracy is limited by measurement errors. The ideal criterion does not itself specify a construction tolerance.

An altitude creates two more similar triangles

Let ∠C=90°, AB=c, AC=b and BC=a. Drop CH=h to the hypotenuse; AH=p and HB=q, so p+q=c. Lengths p and q are the orthogonal projections of the corresponding legs onto AB, rather than the legs themselves.

By AA, triangles ABC, ACH and CBH are similar. Corresponding ratios give:

(c)/(b) = (b)/(p), (c)/(a) = (a)/(q), (p)/(h) = (h)/(q).

Hence:

(b)^(2) = cp, (a)^(2) = cq, (h)^(2) = pq.

Adding the first two again gives a²+b²=c(p+q)=c², another proof through similarity. Euclid VI.8.

In the diagram a=3,b=4,c=5. Thus p=16/5=3.2, q=9/5=1.8 and h=√(3.2·1.8)=2.4. Leg 4 corresponds to projection 3.2, not 1.8: label order matters.

A geometric mean can be constructed

From h²=pq we get h=√(pq), the geometric mean of positive p and q. To construct it, place A,H,B on a line with AH=p and HB=q, draw the semicircle with diameter AB, and erect a perpendicular at H to meet it at C. Angle ACB is right by the diameter property, so CH has the required length.

With p=q it equals p. For unequal p,q, do not confuse √(pq) with the arithmetic mean (p+q)/2. In our example, these are 2.4 and 2.5 respectively.