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!


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$
  • $\begingroup$ Do you have to find x in terms of a or vice versa, or both? If one is to be found in terms of another you can consider the area of the parallelogram as the difference in area of square and two triangles, and get $xT=WH−W(H−T\sin a)$ $\endgroup$ – kuch nahi Jul 10 '11 at 1:10
  • $\begingroup$ I really need both, but can easily derive one from the other. $\endgroup$ – ErikE Jul 10 '11 at 1:11
  • $\begingroup$ I'm sorry, (previous answer)... I took the bar to be centered around the diagonal (I took your reference to the crudity of the diagram literally!) So the lower end of the bar meets the lower right corner, and the upper end of the bar, meets the upper left corner? $\endgroup$ – amWhy Jul 10 '11 at 1:19

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}$.

  • $\begingroup$ Do you mind if I copy your image into my question? It's much better than mine, and other than no "perpendicular squares" (I don't know what they're called) it's perfect. $\endgroup$ – ErikE Jul 10 '11 at 2:05
  • $\begingroup$ @ErikE: Feel free to include the diagram in your question. I just edited it to remove the betas that I didn't end up using and to add some right-angle markings. $\endgroup$ – Isaac Jul 10 '11 at 2:11
  • $\begingroup$ @Isaac: Are you assuming that $E$ is the midpoint of $AD$? $\endgroup$ – Damien Jul 10 '11 at 3:53
  • $\begingroup$ @Damien: Nope, that's just a fluke of my exaggerated diagram. $FC=AE$ since $AFCE$ is a parallelogram, so $BF=H-FC=H-AE$. $\endgroup$ – Isaac Jul 10 '11 at 3:57
  • 1
    $\begingroup$ Calculate twice (in different ways). Cut once. $\endgroup$ – André Nicolas Jul 10 '11 at 4:25

There are cleverer ways of doing it, but let's try for a brute force approach. Let $z$ be the hypotenuse of the little triangle at the top left.

Note that $$\sin\alpha=\frac{T}{z} \qquad\text{and}\qquad \tan\alpha=\frac{W}{H-z}.$$

Take reciprocals, and use $1 +\cot^2\alpha=\csc^2\alpha$. (The trigonometric function calculations and the trigonometric identity substitute for essentially identical similar triangle and Pythagorean Theorem calculations. And it has been a long time since I have been able to mention $\csc$.) We get $$1+\frac{(H-z)^2}{W^2}=\frac{z^2}{T^2}.$$

We solve for $z$ by multiplying both sides by $T^2W^2$ and expanding $(H-z)^2$, obtaining the equivalent quadratic equation $$(W^2-T^2)z^2 +2HT^2z -T^2(W^2+H^2)=0.$$ Solve, discarding the negative solution. At first we obtain $$z=\frac{-2HT^2 +\sqrt{4H^2T^4 +4(W^2-T^2)(T^2)(W^2+H^2)}}{2(W^2-T^2)}.$$ After some manipulation, we obtain the perhaps nicer expression $$z=\frac{-HT^2+WT\sqrt{W^2+H^2 -T^2}}{W^2-T^2}.$$

  • $\begingroup$ Any chance you would solve for $z$? $\endgroup$ – ErikE Jul 10 '11 at 2:00
  • $\begingroup$ Thank you! It's interesting how similar the final equation is to Isaac's. Obviously x and z are interrelated not just by logic by by formula as well. $\endgroup$ – ErikE Jul 10 '11 at 4:39
  • $\begingroup$ @ErikE: Yes, Isaac finds the hypotenuse of one triangle, I find the hypotenuse of another one which is similar to Isaac's. The blow-up factor in going from mine to Isaac's is $W/T$. $\endgroup$ – André Nicolas Jul 10 '11 at 5:01
  • $\begingroup$ @ErikE: user6312's $z$ is my $AE$ and as I'd said in my answer, $AE=\frac{TX}{W}$, so $z=\frac{T}{W}X$ or $X=\frac{W}{T}z$. $\endgroup$ – Isaac Jul 10 '11 at 5:49
  • $\begingroup$ My apologies for blowing up your answer. I usually edit all answers when I change my question in a way that affects them. FWIW, I think you deserve more upvotes. $\endgroup$ – ErikE Jul 10 '11 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.