Consider a right triangle with legs of length h and t.

Select a fraction k between 0 and 1 and mark a length on the hypotenuse that is k times the distance from the end of the segment of length t.

Construct a perpendicular from this point to the segment of length t to construct a similar triangle with sides of length ka, kh, and kt.

Another

SIMILARtriangle can be constructed by drawing a perpendicular to the segment of length h from the upper vertex of our smaller triangle.

The sides of this new triangle will have lengths of (1-k)a, (1-k)t, and (1-k)h. This is one side of the picture for our original triangle and the inscribed rectangle, completed as follows: