Finding the moment about a Point [closed]

I am having a difficult time understanding when to use cos or sin when finding the moment of a force about a point. I understand that moment is $\rm force\cdot distance$. I have attached a picture of a arm with length $L$ where we need to find the moment due to the force of gravity. The answer is $-\frac{mgL}{2}\sin\theta$ and I have no idea why it is $\sin\theta$ and not $\cos\theta$ and what method to use for different problems to know if it is $\cos\theta$ or $\sin\theta$. Thank you]1

closed as off-topic by sammy gerbil, John Rennie, Kyle Kanos, stafusa, Jon CusterNov 17 '17 at 13:53

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Homework-like questions should ask about a specific physics concept and show some effort to work through the problem. We want our questions to be useful to the broader community, and to future users. See our meta site for more guidance on how to edit your question to make it better" – sammy gerbil, Kyle Kanos, stafusa, Jon Custer
If this question can be reworded to fit the rules in the help center, please edit the question.

• What is theta?... – DJohnM Nov 16 '17 at 6:47

Firstly, you need to specify where angle $\theta$ is defined.
From the answer, that it is $\sin\theta$, we can conclude that $\theta$ is the angle between $L$ and $g$. If it was defined as the angle between $L$ and horizontal axis, it would be $\cos\theta$ instead of $\sin\theta$.
A quick trick to do in such situations is to consider the extreme limits. You know that the angular dependence is sinusoidal, and you know that moment is zero if force and distance vectors are parallel. You also know that $\cos 0=1$ and $\sin 0=0$. That means, if the angle you use, say $\theta$, becomes zero when the vectors are parallel, then the angular dependence should be $\sin\theta$. If $\theta$ is $\pi/2$ when the vectors are parallel, then you need $\cos\theta$.