One of the legs of a right triangle has length 4cm. Express the length of the altitude perpendicular to the hypotenuse as a function of the length of the hypotenuse.

I know this divides the Right Triangle into 2 other Right Triangles with an shared side but couldn't see how to set up the equation using this, that is if that is the best way to do it.

The answer to this is $\displaystyle a=\frac{4\sqrt{h^2-16}}{h}$

where $\displaystyle a$ is the length of the altitude and $\displaystyle h$ is the length of the hypotenuse