Given the width W and the height H of a rectangle, and the thickness T of a beam extending exactly from the upper left corner to the lower right corner as shown, how do I solve for length X and angle $\alpha$ as shown in the diagram below? The top of the beam touches the top left corner and the bottom of the beam touches the lower right corner.
Many thanks to Isaac for the excellent diagram!
Update
With the help of Isaac's answer and some careful measurement and cutting with a miter saw, my diagonal beam press-fit into the gate frame exactly and stayed by friction for me to fasten it in. Perfection!
- W $= 39.4375$ in
- H $= 20.6875$ in
T $= 1.53125$ in
X $= 43.77$ in
- $\alpha = 64.29^\circ$
- cutting angle $= 25.71^\circ$