Observe that when we draw an altitude from the right angle to the hypotenuse, we form three similar triangles; since they are similar, then their sides are proportional, as may be seen in the corresponding proportions for each pair of triangles. The triangles have been redrawn outside the main triangle with the altitude.
You may drag point B to see how these proportions remain true. For some parts in the trajectory of point B the internal rounding of the computer will show a difference in the hundredths for some of the values.
Didn't you find what you were looking for? Do your search here!