The distance of the pendulum from the vertical is equivalent to the leg of a right triangle with opposite angle 30° and hypotenuse 40 in. In this case, the length of the leg x is given by:
[tex]\begin{gathered} x=40\sin30\degree \\ x=40\frac{1}{2} \\ x=20\text{ in} \end{gathered}[/tex]