A right triangle is a triangle with a right angle. The opposite side to the right angle is called the hypotenuse and the other sides are the legs. Given an angle in a right triangle, the ratio between the leg adjacent to the angle and the hypotenuse is equal to the cosine of the angle.
Using this relation in our problem, we have the following:

Solving this expression for q, we have:

And this is our answer.
