Simple geometry/trigonometry question

How to find the X coordinate of the red point if i know it's Y coordinate and the angle? Let's say the Y is 40 and the angle is 30 degrees:

-

Hint: think about the definition of the tangent of the angle.

-

If the angle from the diagonal line to the $x$-axis is $\theta$, and the $y$-coordinate of the red dot is $a$, then the $x$-coordinate of the red dot is $$\frac{a}{\tan(\theta)}.$$ In your example, $a=40$ and $\theta=30^\circ$, so the $x$-coordinate would be $$\frac{40}{\tan(30^\circ)}=\frac{40}{\sqrt{3}}=\frac{40\sqrt{3}}{3}\approx 23.09.$$

-

Suppose that the angle is between the $x$-axis and the line that goes through the origin is $\theta$. Using trigonometry, we have $$\tan\theta= \frac{y}{x}.$$

What you have is the $y$-coordinate and the value of $\theta$. So you put the values in

$$\tan (30^{\circ})= \frac{40}{x}.$$

Rearranging, we have $$x = \frac{40}{\tan (30^{\circ})}.$$

-