Let the bottom left vertex of the right triangle lie at (0,0).....so.....the square will touch two sides of the triangle
Let the height of the right triangle = 5 and the base length = 12
And the endpoints of the hypotenuse lie at (0,12) and (5,0)
And the equation of the line conecting these two points is given by :
y = -(12/5)x + 12 (1)
And the diagonal of the square will be the segment lying on the line y = x (2)
Find the x coordinate intersection of (1) and (2) ..... this will be the length of the side of the square
So we have
- (12/5)x + 12 = x add -(12/5) to both sides
12 = (17/ 5) x multiply both sides by 5/17
60/17 units = the side of the square