The geometric mean theorem, also called the right triangle altitude theorem, says that the altitude from the right angle to the hypotenuse is the geometric mean of the two pieces it cuts the hypotenuse into: h2 = pq. Its companion, the leg rule, says each leg is the geometric mean of the hypotenuse and the piece next to that leg.
Both rules come from one observation: the altitude splits a right triangle into two smaller right triangles that have exactly the same shape as the original. Combine the two leg rules and you get one of the shortest proofs of the Pythagorean theorem.
The altitude on the hypotenuse
Take a right triangle ABC with the right angle at C, legs a = BC and b = AC, and hypotenuse c = AB. The altitude to the hypotenuse is the segment from C that meets AB at a right angle. Call its length h and its foot D.
The foot D splits the hypotenuse into two pieces. In this page, p = DB is the piece next to leg a, and q = AD is the piece next to leg b, so p + q = c. (Some textbooks swap the letters or call the pieces the projections of the legs onto the hypotenuse; what matters is which piece touches which leg.)
Because the angles at A and B are both acute, the foot D always lands strictly between A and B, so both pieces have positive length. For the general idea of altitudes in any triangle, see the height of a triangle.
The geometric mean of two positive numbers x and y is √xy, the number m with x over m = m over y. The geometric mean of 4 and 9 is √36 = 6, because 4 over 6 = 6 over 9. Euclid called it the mean proportional.
Three similar triangles
The altitude creates two smaller triangles, ADC and CDB. Each of them is similar to the original triangle ACB, and therefore to each other.
- △ADC ∼ △ACB: both have a right angle (at D and at C) and both contain the angle at A. Two equal angles are enough for similarity (the AA rule).
- △CDB ∼ △ACB: both have a right angle and both contain the angle at B.
- △ADC ∼ △CDB: each is similar to the big triangle, so they are similar to each other. Concretely, angle ACD = 90° − A = B, so the two pieces share their acute angles.
Similar triangles have proportional sides. Writing each triangle as (short leg, long leg, hypotenuse) in the 15-20-25 example drawn above gives (9, 12, 15), (12, 16, 20) and (15, 20, 25): every triple is a multiple of the 3-4-5 triangle. Lining up corresponding sides is the whole proof of the next section. (Any right triangle works; the numbers here just happen to be a Pythagorean triple.)
| Triangle | Side opposite angle A | Side next to angle A | Hypotenuse |
|---|---|---|---|
| △CDB (small) | p | h | a |
| △ADC (medium) | h | q | b |
| △ACB (whole) | a | b | c |
In the small triangle the angle equal to A is at C (angle DCB), which is why its "opposite" side is p.
The formulas: h² = pq, a² = pc, b² = qc
Each formula comes from setting two ratios of corresponding sides equal, then cross-multiplying.
The altitude rule
Compare the small and medium triangles, using (side opposite A) ÷ (side next to A):
p over h = h over q ⇒ h2 = pq or h = √pqThe leg rule
Compare each piece with the whole triangle, using (side opposite A) ÷ hypotenuse for the small one and (side next to A) ÷ hypotenuse for the medium one:
p over a = a over c⇒ a2 = pcq over b = b over c⇒ b2 = qcIn words: each leg is the geometric mean of the whole hypotenuse and the piece of the hypotenuse next to it. Some books call this the leg theorem or Euclid's theorem.
A bonus: h = ab/c
The area of the triangle can be computed two ways, with the legs as base and height or with the hypotenuse as base and h as height: 1 over 2ab = 1 over 2ch. So the altitude is also
h = ab over cKey ideaAltitude rule: h2 = pq. Leg rule: a2 = pc and b2 = qc, where p is the piece next to a and q the piece next to b.
Euclid proved the similar-triangles fact as Book VI, Proposition 8 of the Elements, and stated the altitude rule as its corollary: the perpendicular is a mean proportional between the two segments of the base.
How the leg rule adds up to the Pythagorean theorem
Add the two leg rules and factor out c:
a2 + b2= pc + qc= (p + q)c= c · c = c2That is the whole similar triangles proof of the Pythagorean theorem, and it is why the proof is often called the shortest one. It needs no rearranged squares, only the fact that similar triangles have proportional sides.
The leg rule also has an area meaning. a2 = pc says the square on leg a has the same area as a p × c rectangle, and the altitude, extended down through the square on the hypotenuse, cuts that square into exactly those two rectangles. Euclid's proof (Elements I.47) shows the two area equalities with congruent triangles instead of similarity, and the other approaches are collected on the proofs page.
Worked examples
Example 1: altitude from the two pieces Level 1
The altitude to the hypotenuse divides it into pieces p = 4 and q = 9. Find h and both legs.
h= √4 · 9 = √36 = 6c= 4 + 9 = 13a= √pc = √4 · 13 = √52 = 2√13 ≈ 7.21b= √qc = √9 · 13 = √117 = 3√13 ≈ 10.82h = 6, a = 2√13 ≈ 7.21 and b = 3√13 ≈ 10.82. Check: 52 + 117 = 169 = 132.
Example 2: one piece missing Level 1
The altitude is 8 and the piece next to leg a is p = 4. Find q, c and the legs.
82= 4q ⇒ q = 16c= 4 + 16 = 20a= √4 · 20 = √80 = 4√5 ≈ 8.94b= √16 · 20 = √320 = 8√5 ≈ 17.89q = 16, c = 20, a ≈ 8.94 and b ≈ 17.89. Need help simplifying √80? See square roots and radicals.
Example 3: from the legs Level 2
A right triangle has legs a = 6 and b = 8. Find the altitude to the hypotenuse and the two pieces.
c= √62 + 82 = 10p= a2 over c = 36 over 10 = 3.6, q = b2 over c = 64 over 10 = 6.4h= ab over c = 48 over 10 = 4.8h = 4.8, p = 3.6 and q = 6.4. The altitude rule confirms it: 3.6 × 6.4 = 23.04 = 4.82.
Example 4: a leg and its piece Level 2
Leg a = 12, and the piece of the hypotenuse next to it is p = 8. Find c, q, h and b.
122= 8c ⇒ c = 18q= 18 − 8 = 10h= √8 · 10 = √80 = 4√5 ≈ 8.94b= √10 · 18 = √180 = 6√5 ≈ 13.42c = 18, q = 10, h ≈ 8.94 and b ≈ 13.42. Check: 144 + 180 = 324 = 182.
Example 5: the pieces from the hypotenuse and the altitude Level 3
The hypotenuse is 10 and the altitude to it is 4.8. How long are the two pieces?
You know p + q = 10 and pq = h2 = 23.04. Substituting q = 10 − p gives a quadratic:
p(10 − p)= 23.04p2 − 10p + 23.04= 0p= 10 ± √100 − 92.16 over 2 = 10 ± 2.8 over 2The pieces are 6.4 and 3.6, the triangle from Example 3. The two solutions of the quadratic are simply the two pieces, so either can be called p.
The right triangle calculator reports the altitude to the hypotenuse for any triangle you enter, which is a quick way to check answers like these.
Constructing a square root
The altitude rule gives a classic ruler-and-compass way to draw a segment of length √n. Lay segments of length p and q end to end, draw a semicircle on the whole segment, and raise a perpendicular at the point where they meet. Any angle inscribed in a semicircle is a right angle (Thales' theorem), so the perpendicular is the altitude of a right triangle, and its height is √pq.
With p = 1 and q = n, the height is exactly √n. This construction is Euclid's Book VI, Proposition 13, "to find a mean proportional", and it is one of the ways to build the lengths in the spiral of Theodorus.
Common mistakes
- Pairing a leg with the wrong piece. In a2 = pc, the piece p must be the one that touches leg a (they meet at vertex B). Using the far piece gives the wrong leg.
- Using the whole hypotenuse in h2 = pq. The altitude rule uses the two pieces; the leg rule uses one piece and the whole hypotenuse.
- Forgetting c = p + q. Many problems give two of p, q, c; the third comes from this sum, not from another formula.
- Using the rules in the wrong triangle. They need a right angle, and the altitude must be drawn from that right angle to the hypotenuse.
Frequently asked questions
What does the geometric mean theorem say?
In a right triangle, the altitude from the right angle to the hypotenuse equals the geometric mean of the two segments it creates: h = √pq. For segments of 4 and 9, the altitude is √36 = 6.
What is the leg rule?
Each leg of a right triangle is the geometric mean of the hypotenuse and the segment of the hypotenuse next to that leg: a = √pc and b = √qc. It comes from the similarity of each small triangle with the whole triangle.
How do you find the altitude to the hypotenuse?
If you know the two segments, use h = √pq. If you know the legs, use h = ab over c, which comes from computing the area two ways. For legs 6 and 8, h = 48 over 10 = 4.8.
Why are the three triangles similar?
Each small triangle has a right angle and shares one acute angle with the original triangle, so by the angle-angle rule it is similar to the original. Two triangles that are both similar to a third are similar to each other.
How is the geometric mean theorem related to the Pythagorean theorem?
Adding the two leg rules gives a2 + b2 = pc + qc = (p + q)c = c2, which proves the Pythagorean theorem. The altitude rule h2 = pq is a separate consequence of the same similar triangles.
Does the geometric mean theorem have a converse?
Yes. If the altitude from C meets AB at a point D between A and B, and CD2 = AD · DB, then angle C is a right angle. The condition makes triangles ADC and CDB similar, and their angles at C then add up to 90°.
Keep exploring
- ProofsSimilar Triangles Proof of the Pythagorean TheoremProve the Pythagorean theorem with similar triangles: the altitude to the hypotenuse makes three similar right triangles, so a² = cp, b² = cq and a² + b² = c².
- ProofsEuclid's Proof of the Pythagorean TheoremEuclid's windmill proof of the Pythagorean theorem, Book I Proposition 47, step by step: congruent triangles, an animated shear and the converse, I.48.
- LearnFind the Height of a Triangle with the Pythagorean TheoremFind the height of an isosceles or equilateral triangle with the Pythagorean theorem: h = √(s² − (b/2)²), h = (√3/2)s, area formulas and slant heights.
- CalculatorsRight Triangle Calculator and SolverRight triangle solver: enter any two values, such as two sides or a side and an angle, to get all three sides, both angles, area, perimeter, altitude and radii.
- ProofsProofs of the Pythagorean TheoremProofs of the Pythagorean theorem: an animated proof, how a proof differs from checking examples, all 12 proofs on this site by type, and where to start.
- LearnSquare Roots and Radicals for the Pythagorean TheoremThe square-root toolkit for the Pythagorean theorem: perfect squares 1–30, estimating roots, simplest radical form step by step, exact vs decimal answers.