In order to find the cosine of theta, first let's find the length of the third side of the triangle, using Pythagorean theorem:
The cosine relation is given by the length of the adjacent side to the angle over the length of the hypotenuse.
So we have: