Hi Billy J.
The following Trigonometric functions; sine, cosine and tangent apply to the sides and angles in every right triangle
For angle x
The cosine of angle x is Adjacent side, which is side y divided by the hypotenuse, or the longest side of the right triangle, in your drawing the longest side is the distance between the sun and the moon
For angle x
y/(cosine x) = distance between the sun and the moon
You can look up the Trigonometric Function typically used with Right Triangles in your text or on the internet.
They are usually referred to Sin, Cos, and Tan when applied to a Right Triangle
Sin = Side Opposite of the given angle/(Hypotenuse)
Cos = Side Adjacent to the given angle/(Hypotenuse)