The right triangle altitude theorem says that the altitude drawn from the right angle to the hypotenuse is the geometric mean of the two segments it cuts the hypotenuse into: h² = p · q, so h = √(p · q). The same picture produces a second result, the leg theorem, which says each leg is the geometric mean of the whole hypotenuse and the segment next to it: a² = c · p and b² = c · q. Both follow from one fact, that the altitude splits the triangle into two smaller triangles similar to the original and to each other.
The altitude theorem, the leg theorem and the leg-product formula for h.
Notation used throughout
Every statement below uses one fixed labelling, so read this before the proofs.
- The right angle sits at vertex C, and the acute angles at A and B.
- Leg a is opposite angle A, so it runs from C to B. Leg b is opposite angle B, running from C to A. The hypotenuse c runs from B to A.
- The altitude h is drawn from C perpendicular to the hypotenuse, and its foot is called D.
- p is the piece of the hypotenuse next to leg a: they meet at vertex B.
- q is the piece next to leg b: they meet at vertex A.
- D lies between B and A, so
c = p + q.
The figures below put the right angle C at the bottom left, leg a vertical, leg b horizontal, vertex B at the top left and vertex A at the bottom right. So p is the upper-left part of the hypotenuse, running down from B to the foot D, and q is the lower-right part, from D down to A. Pair each leg with the segment that shares a vertex with it, never with the segment across the foot.
Figure 1
What the altitude to the hypotenuse actually is
An altitude is a segment from a vertex perpendicular to the line containing the opposite side, and a triangle has three of them. In a right triangle two are the legs themselves, since leg a is already perpendicular to leg b. Only the third matters here: the altitude from the right angle at C down to the hypotenuse. Three properties make it special.
- Its foot lands strictly inside the hypotenuse. Angles A and B are acute, so the perpendicular from C meets BA between the endpoints rather than on an extension. Both p and q are therefore positive and smaller than c.
- It is the shortest distance from C to the hypotenuse. Any other segment from C to that line is the hypotenuse of a small right triangle having h as a leg.
- It creates two new right angles at D. Angles CDB and CDA are both 90°, and that is the engine of every proof below.
The three similar triangles
Drawing h from C produces triangle BDC and triangle ADC. With the original triangle ABC that gives three right triangles, and all three are similar by the angle-angle criterion: two triangles are similar if two angles of one equal two angles of the other. Each small triangle has a right angle at D, and each shares one acute angle with the original.
Triangle BDC matches triangle BCA
Triangle BDC shares angle B with triangle ABC, because angle DBC and angle CBA are the same angle. With the right angles that is two matching pairs, so the triangles are similar:
△BDC ~ △BCA, with B ↔ B, D ↔ C, C ↔ A.
The third pair confirms the order. Angle BCD equals 90° − B, and so does angle BAC, since the acute angles of a right triangle sum to 90°.
Triangle ADC matches triangle ACB
Triangle ADC shares angle A with triangle ABC, so again two pairs match:
△ADC ~ △ACB, with A ↔ A, D ↔ C, C ↔ B.
Third pair: angle ACD equals 90° − A, and so does angle ABC.
The two small triangles match each other
Similarity is transitive, so triangle BDC and triangle ADC are similar as well:
△BDC ~ △CDA, with B ↔ C, D ↔ D, C ↔ A.
Angle B and angle DCA both equal 90° − A, and angle BCD and angle A both equal 90° − B. The article on similar right triangles covers the AA criterion behind these matchings in more detail.
Deriving h² = p · q
Use the third similarity, â–³BDC ~ â–³CDA, since that is the one that puts h on both sides of a ratio.
Step 1. Write the corresponding sides. Under B ↔ C, D ↔ D, C ↔ A, side BD corresponds to side CD, side DC corresponds to side DA, and side BC corresponds to side CA.
Step 2. Set the first two ratios equal: BD / CD = DC / DA.
Step 3. Translate into letters. BD is p, CD and DC are both h, and DA is q, giving p / h = h / q.
Step 4. Cross-multiply: h · h = p · q, so h² = p · q and h = √(p · q).
The altitude theorem, read straight off the similarity of the two small triangles.
The proportion p / h = h / q is exactly what “geometric mean” means: a number g is the geometric mean of x and y when x / g = g / y, which rearranges to g = √(x · y). That is why the result is often called the right triangle geometric mean theorem, and the geometric mean in right triangles article takes the idea further.
One consequence: h is never more than c / 2, because a geometric mean never exceeds the matching arithmetic mean, and the arithmetic mean of p and q is c / 2. Equality needs p = q, the isosceles right triangle.
Deriving the leg theorem: a² = c · p and b² = c · q
The same picture gives a second relationship for each leg, usually called the leg theorem, or Euclid’s theorem on the legs.
For leg a, use â–³BDC ~ â–³BCA. Corresponding sides pair BD with BC, and BC with BA, so BD / BC = BC / BA. Translating, BD is p, BC is leg a, and BA is the full hypotenuse c:
p / a = a / c, and cross-multiplying gives a² = c · p.
For leg b, use â–³ADC ~ â–³ACB. Corresponding sides pair AD with AC, and AC with AB, so AD / AC = AC / AB. Translating, AD is q, AC is leg b, and AB is c:
q / b = b / c, and cross-multiplying gives b² = c · q.
The leg theorem. Each leg is the geometric mean of the hypotenuse and the segment touching that leg.
So each leg is the geometric mean of the whole hypotenuse and the segment adjacent to it. Mind which segment: leg a pairs with p because they meet at vertex B, and leg b pairs with q because they meet at vertex A.
Adding the two results gives a bonus:
a² + b² = c · p + c · q = c · (p + q) = c · c = c²
That is the Pythagorean theorem, recovered in one line from the altitude picture, which makes this decomposition one of the shortest proofs of Pythagoras there is. You can sanity-check any numbers it produces against the right triangle calculator on the homepage.
Why h = (a · b) / c, and why it agrees with √(p · q)
A second formula for the altitude uses the legs instead of the segments, and it comes from area. Taking the legs as base and height, the area is (1/2) · a · b. Taking the hypotenuse as the base, the matching height is the altitude, so the area is (1/2) · c · h. Setting them equal, multiplying by 2 and dividing by c:
h = (a · b) / c
Now show that this agrees with h = √(p · q). Solve the leg theorem for each segment, p = a² / c and q = b² / c, then multiply:
p · q = (a² / c) · (b² / c) = (a² · b²) / c² = ((a · b) / c)²
Every quantity is positive, so taking square roots gives √(p · q) = (a · b) / c. The left side is h by the altitude theorem, the right side is h by the area argument, so the two formulas name the same number. Use h = (a · b) / c when you know the legs and h = √(p · q) when you know the segments.
The two formulas for h are algebraically identical.
Numerical check
Take a 3-4-5 triangle. From the legs, h = 12 / 5 = 2.4. From the leg theorem, p = 9 / 5 = 1.8 and q = 16 / 5 = 3.2, summing to 5 as they must. From the altitude theorem, h = √(1.8 · 3.2) = √5.76 = 2.4. The routes agree exactly, and the leg theorem checks both ways: 5 à - 1.8 = 9 = 3² and 5 à - 3.2 = 16 = 4².
Figure 2
Notice the pairing in Figure 2. The shorter leg, 3, sits next to the shorter segment, 1.8, and the longer leg, 4, next to the longer segment, 3.2. That ordering always holds, because p / q = a² / b².
Finding the altitude
Problem 1 Altitude from the two segments
- Given
- The altitude divides the hypotenuse into p = 4 and q = 9
- Find
- The altitude h
- Formula
- h = √(p · q)
- Substitution
- h = √(4 à - 9)
- Calculation
- h = √36
Answer h = 6
Check against the leg theorem. Here c = 13, so a = √52 = 2√13 ≈ 7.211 and b = √117 = 3√13 ≈ 10.817, giving 52 + 117 = 169 = 13². The leg route agrees: 78 / 13 = 6.
Problem 2 Altitude from the two legs
- Given
- Legs a = 6 and b = 8
- Find
- The altitude h to the hypotenuse
- Formula
- c = √(a² + b²), then h = (a · b) / c
- Substitution
- c = √(36 + 64) = 10, h = (6 à - 8) / 10
- Calculation
- h = 48 / 10
Answer h = 4.8
Confirm with the altitude theorem: p = 3.6 and q = 6.4 add to 10, and √(3.6 à - 6.4) = √23.04 = 4.8.
Finding the two segments
Problem 3 Segments of a 5-12-13 triangle
- Given
- a = 5, b = 12, c = 13
- Find
- The segments p and q
- Formula
- p = a² / c and q = b² / c
- Substitution
- p = 25 / 13, q = 144 / 13
- Calculation
- p ≈ 1.9231, q ≈ 11.0769
Answer p = 25/13 ≈ 1.92, q = 144/13 ≈ 11.08 (2 dp)
Keep the fractions until the end. Here h = 60 / 13 ≈ 4.6154, so h² = 3600 / 169, and p · q = (25/13) à - (144/13) = 3600 / 169 as well. The 5-12-13 triangle has integer sides, but its altitude and segments are not integers.
Problem 4 Segments from the hypotenuse and the altitude
- Given
- c = 25 and h = 12
- Find
- The segments p and q
- Formula
- p + q = c and p · q = h², so p and q solve x² − c·x + h² = 0
- Substitution
- x² − 25x + 144 = 0
- Calculation
- x = (25 ± √(625 − 576)) / 2 = (25 ± 7) / 2
Answer The segments are 9 and 16
The quadratic does not say which root is p, because the segments enter symmetrically in both p + q = c and p · q = h². You need one more fact, such as which leg is longer. If a is the shorter leg then p = 9 and q = 16, so a = √225 = 15 and b = √400 = 20: a 15-20-25 triangle, with h = 300 / 25 = 12 as required.
Finding the legs
Problem 5 Legs from the hypotenuse and one segment
- Given
- c = 20 and p = 5
- Find
- Both legs and the altitude
- Formula
- a = √(c · p), q = c − p, b = √(c · q)
- Substitution
- a = √(20 à - 5), q = 20 − 5 = 15, b = √(20 à - 15)
- Calculation
- a = √100 = 10, b = √300 = 10√3 ≈ 17.321
Answer a = 10, b = 10√3 ≈ 17.32, h = √(5 à - 15) = 5√3 ≈ 8.66
Checks: 100 + 300 = 400 = 20², and h = (10 à - 10√3) / 20 = 5√3, matching √75 = 5√3 ≈ 8.660. This triangle is a 30-60-90, since a / c = 0.5.
Problem 6 Legs from the altitude and one segment
- Given
- h = 12 and p = 8
- Find
- q, c and both legs
- Formula
- q = h² / p, c = p + q, a = √(c · p), b = √(c · q)
- Substitution
- q = 144 / 8 = 18, c = 8 + 18 = 26
- Calculation
- a = √(26 à - 8) = √208 = 4√13, b = √(26 à - 18) = √468 = 6√13
Answer q = 18, c = 26, a = 4√13 ≈ 14.42, b = 6√13 ≈ 21.63
Verify: 208 + 468 = 676 = 26², and h = (4√13 à - 6√13) / 26 = 312 / 26 = 12.
Problem 7 A roof truss
- Given
- A truss has a right angle at the ridge, with rafters of 9 m and 12 m
- Find
- The vertical drop from the ridge to the tie beam, and where it meets the beam
- Formula
- c = √(a² + b²), h = (a · b) / c, p = a² / c
- Substitution
- c = √(81 + 144) = 15, h = (9 à - 12) / 15, p = 81 / 15
- Calculation
- h = 108 / 15 = 7.2, p = 5.4, q = 15 − 5.4 = 9.6
Answer The drop is 7.2 m, meeting the beam 5.4 m from the end under the 9 m rafter
Check: 5.4 à - 9.6 = 51.84 and 7.2² = 51.84. For the two acute angles of that truss you can solve the triangle in one step with the calculator.
Verification table
Every row was computed from the legs, then checked both ways. Values are rounded to four decimals for display only.
| a | b | c | h = ab/c | p = a²/c | q = b²/c | h² = p · q |
|---|---|---|---|---|---|---|
| 3 | 4 | 5 | 2.4 | 1.8 | 3.2 | 5.76 = 5.76 ✓ |
| 6 | 8 | 10 | 4.8 | 3.6 | 6.4 | 23.04 = 23.04 ✓ |
| 9 | 12 | 15 | 7.2 | 5.4 | 9.6 | 51.84 = 51.84 ✓ |
| 5 | 12 | 13 | 4.6154 | 1.9231 | 11.0769 | 21.3018 = 21.3018 ✓ |
| 8 | 15 | 17 | 7.0588 | 3.7647 | 13.2353 | 49.8270 = 49.8270 ✓ |
Two patterns show up. First, p + q = c in every row, including 3.7647 + 13.2353 = 17. Second, the segment ratio matches the squared leg ratio: in the 8-15-17 row, p / q ≈ 0.2844 and a² / b² = 64 / 225 ≈ 0.2844. Integer legs rarely give integer segments.
Common mistakes
Swapping p and q
This is the error that costs the most marks. The leg theorem pairs each leg with the segment that touches it, not with the one across the foot: leg a touches p at vertex B, and leg b touches q at vertex A.
Watch what the swap does. In a 5-12-13 triangle the true segments are p = 25/13 ≈ 1.923 and q = 144/13 ≈ 11.077. Given c = 13 and q ≈ 11.077, the correct route to leg a is p = 13 − 11.077 = 1.923, then a = √(13 à - 1.923) = √25 = 5. Pair a with the wrong segment and you get a = √(13 à - 11.077) = √144 = 12, which is leg b. The answer is off by a factor of 2.4, and since 12 is a believable side length here, nothing looks wrong until you test a² + b².
The fix is a two-second habit. Before substituting, point at the vertex where the leg and the segment meet; if they do not share one, the pair is wrong. Size ordering is a second check, since the longer leg sits next to the longer segment.
Putting c where a segment belongs
h² = p · q uses the two segments, not the whole hypotenuse, so it is not h² = p · c. In the 3-4-5 triangle the wrong version gives √(1.8 à - 5) = 3, larger than the shorter leg and therefore impossible for an altitude. The same slip appears when p is given with c: the other segment is q = c − p, so p = 4 with c = 13 means q = 9. Writing c = p + q first prevents both.
Treating h as half the hypotenuse
h = c / 2 only in the isosceles right triangle, where p = q. Everywhere else h is strictly less than c / 2. In the 5-12-13 triangle c / 2 = 6.5 but h ≈ 4.615.
Rounding a segment before computing a leg
In a 5-12-13 triangle, rounding p = 1.9231 to 1.9 and then computing a = √(13 à - 1.9) ≈ 4.970 gives 4.97 instead of exactly 5. Carry 25/13 through and round at the end.
Treating h as a side of the original triangle
h is a leg of each small triangle but never a side of triangle ABC, so a² + h² = c² is false. The only relationships involving h are h² = p · q and h = (a · b) / c.
Practice
Work these on paper, then check the key. For a longer drill set on the same relationships, see the companion post on applying the geometric mean.
- An altitude to the hypotenuse divides it into segments of 3 and 12. Find h, c and both legs in exact radical form.
- A right triangle has legs 9 and 40. Find c, h, p and q, rounding the last three to two decimals.
- In a right triangle,
p = 16andq = 18. Find c, h, a and b in radical form, then confirm Pythagoras. - The altitude is 10 and the segment next to leg b is 25. Find p, c, a and b.
Answer key
1. h = √36 = 6 and c = 15. Then a = √45 = 3√5 ≈ 6.708 and b = √180 = 6√5 ≈ 13.416. Check: 45 + 180 = 225 = 15², and (3√5 · 6√5) / 15 = 90 / 15 = 6.
2. c = √1681 = 41, h = 360 / 41 ≈ 8.78, p = 81 / 41 ≈ 1.98, q = 1600 / 41 ≈ 39.02. Check: the segments sum to 41, and p · q = 129600 / 1681 ≈ 77.096, matching h² ≈ 77.096.
3. c = 34 and h = √288 = 12√2 ≈ 16.971. Then a = √544 = 4√34 ≈ 23.324 and b = √612 = 6√17 ≈ 24.739. Check: 544 + 612 = 1156 = 34².
4. The segment next to leg b is q, so q = 25, p = 100 / 25 = 4 and c = 29. Then a = √116 = 2√29 ≈ 10.770 and b = √725 = 5√29 ≈ 26.926. Check: 116 + 725 = 841 = 29², and 290 / 29 = 10 = h.
Frequently Asked Questions
What is the right triangle altitude theorem?
The right triangle altitude theorem states that the altitude drawn from the right angle to the hypotenuse is the geometric mean of the two segments it divides the hypotenuse into, so h² = p · q. It follows from the altitude splitting the triangle into two triangles similar to the original, and it is sometimes called the geometric mean altitude theorem.
Does the altitude theorem work in any triangle?
No. It needs a right angle, and the altitude has to be the one drawn from that right angle. In an acute or obtuse triangle the altitude from a vertex does not produce similar triangles, so h² = p · q fails. In an obtuse triangle the foot can even land outside the opposite side.
What is the difference between the altitude theorem and the leg theorem?
The altitude theorem relates h to the two segments, h² = p · q, while the leg theorem relates each leg to the whole hypotenuse and one segment, a² = c · p and b² = c · q. The first uses the similarity of the two small triangles to each other, the second the similarity of each small triangle to the original.
Is h = (a · b) / c the same as h = √(p · q)?
Yes. Substituting p = a² / c and q = b² / c into √(p · q) gives √(a²b² / c²) = (a · b) / c. Use the leg version when the legs are known and the segment version when the segments are known. In a 3-4-5 triangle both give 2.4.
Can the altitude be longer than a leg?
No. The altitude is the shortest distance from the right angle to the hypotenuse, while each leg is a slanted path from that same vertex to the same line, so h is smaller than both a and b. In a 3-4-5 triangle h = 2.4, shorter than 3 and 4. If your h exceeds a leg, recheck how you paired legs with segments.