The altitude of a right triangle from its right angle to its hypotenuse is the geometric mean of the lengths of the segments the hypotenuse is split into. Using
Pythagoras' theorem on the 3 triangles of sides
(p + q, r, s),
(r, h, p) and
(s, h, q),
[math]\displaystyle{ \begin{align}
(p + q)^2 \quad &= \quad\;\, r^2 \quad + \quad s^2 \\
p^2 \!+ 2pq + q^2 &= \left(h^2 \!\!+\! p^2\right) \!+\! \left(h^2 \!\!+\! q^2\right) \\
2pq \qquad\, &= 2h^2 \quad \therefore h = \sqrt{pq} \\
\end{align} }[/math]