Force of an ideal spring Suppose you have an ideal spring (constant of the spring $k$) attached to a uniform disc of radius $R$ as in the picture below:

The force $F$ in red is from the spring.
My question is the following:
How should I decompose the force $F$ into its $x$ and $y$ components??
My intuition would tell me to multiply the module of the force by the sine and cosine of the angle between $F$ and the $x$ axis or something similar, however I noted in some exercises and exams, the solution simply states that $F_x = -kS(u_x)$ where $S$ is the distance from the y axis, $u_x$ the unit vector of the $x$ axis and $F_x$, of course, the $x$ component of $F$. What is the correct approach? I could not find anything useful on the internet so far...
 A: If $S$ is de distance from $C$ to de $y$ axis, then $S=|r|\cos(\theta)$ where $r$ is the position of $C$ with respect to the origin and $\theta$ is the angle between the spring and the $x$ axis. However if you want to write $F_y$ then you would have $F_y=-k|r|\sin(\theta)u_y$. So you were correct in thinking in the decomposition of $F$ as a function of $\theta$ observer however that $S$ is not $|r|$ which is a crucial difference.
A: You have a correct answer, but I'm not sure if you have it for the right reason. Hooke's law states that
$$ \vec{F}_{\text{spring}} = -k\vec{r}$$
where $\mathbf{r}$ is the displacement of the spring from its equilibrium length (which you have not provided in the problem). If you take the equilibrium length to be 0, the spring force then has a magnitude
$$|\vec{F}_{\text{spring}}| = kR$$
where $R$ is the distance between the center of the disk and the origin.
Taking $\theta$ to be the angle between the angle the spring makes with the x axis, then,
$$\vec{F_x} = - kR \cos{\theta} \hat{u_x}$$
$$\vec{F_y} = - kR \sin{\theta} \hat{u_y}$$
High school trig tells you that $\cos{\theta} = \text{adjacent}/\text{hypotenuse}$ and $\sin{\theta} = \text{opposite}/\text{hypotenuse}$. In this case $\cos{\theta} = S/R$ and $\sin{\theta} = \sqrt{R^2-S^2}/R$. Therefore,
$$\vec{F_x} = - kR\Big(\frac{S}{R}\Big)\hat{u_x} = -kS\hat{u_x}$$
$$\vec{F_y} = - kR \Big( \frac{\sqrt{R^2-S^2}}{R} \Big) \hat{u_y} = -k\sqrt{R^2-S^2}\hat{u_y}$$
