How this calculation works
The altitude is the geometric mean of the two segments because the three right triangles are similar.
h = √(pq)A worked example
Segments 4 and 9 give an altitude √36 = 6 and a total hypotenuse of 13.
Good to know
This relation applies to the altitude from the right-angle vertex.
Reference: OpenStax Algebra and Trigonometry, Trigonometric Applications (opens in a new tab) ↗
Use similar triangles to connect the two hypotenuse pieces
Draw the perpendicular from the right-angle vertex to the hypotenuse. It divides the hypotenuse into positive segments p and q and forms two smaller right triangles. Similarity gives p/h = h/q, so h² = pq and h = √(pq).
For p = 4 and q = 9, the altitude is √36 = 6 and the complete hypotenuse is 13. The two legs have lengths √[p(p + q)] = √52 and √[q(p + q)] = √117. Their squares add to 169, confirming the square of the full hypotenuse.
Connect the altitude to area and the geometric mean
Using the hypotenuse as a base gives area (p + q)h/2. The default triangle therefore has area 13 × 6/2 = 39. Using the two perpendicular legs instead gives √52 × √117/2 = 39, an independent geometric check.
The altitude is the geometric mean of the segments. Swapping p and q leaves it unchanged and exchanges the two legs. If p = q, the altitude equals either segment and the triangle is isosceles. The Triangle median length calculator gives a different segment from the right-angle vertex, the median to the hypotenuse. Its length is always half the hypotenuse. This altitude formula specifically requires a right triangle and the perpendicular drawn to its hypotenuse.
A few questions, answered
Can either segment be zero?
The calculator requires positive segments. A zero segment would give zero altitude and a degenerate triangle.
Is the altitude the average of the two pieces?
It is their geometric mean √(pq), which generally differs from their arithmetic mean (p + q)/2.