[Math] Calculate measurements for a diagonal fence beam

euclidean-geometrygeometrytrigonometry

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.

frame diagonal

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$

Best Answer

re-diagram with points and angles labeled

Let's start with a careful diagram with lots of labels to make it easier to discuss. I've also exaggerated the width $T$ of the bar to be sure we're talking about the same placement and to make it easier to label things. I also changed $x$ to $X$ and $a$ to $\alpha$. You are given $W$, $H$, and $T$, and want to determine $X$ and $\alpha$. Because of various parallel and perpendicular things, I've labeled some more angles $\alpha$.

Looking at $\triangle ABF$ and $\triangle EGA$, $\sin\alpha=\frac{W}{X}=\frac{T}{AE}$, so $AE=\frac{TX}{W}$. In $\triangle ABF$, applying the Pythagorean theorem, $$X^2=W^2+(H-AE)^2=W^2+\left(H-\frac{TX}{W}\right)^2.$$ Solving for $X$ in terms of $W$, $H$, and $T$ (with the assumption that $0< T< H< W$) gives $$X=\frac{-HWT+W^2\sqrt{H^2+W^2-T^2}}{W^2-T^2}.$$

Knowing $X$, since $\sin\alpha=\frac{W}{X}$, $\alpha=\arcsin\frac{W}{X}$.

Related Question