How do I solve for the angle "t" in the following equation:
$$\cos(t) ( p_x \cos(s) + p_y \sin(s) ) + \sin(t) ( p_y \cos(s) - p_x \sin(s) ) = t_x \cos(s) + t_y \sin(s)$$
where $p_{x/y}$, $t_{x/y}$, and s are known.
I've tried to substitute cos by sqrt(1-sin^2), or tried to make the equation become cos^2 + sin^2 = 1, but got stuck.
To provide the physical meaning of this equation ( see picture link below) , basically this is to find out the angle such that after the rotation around the cyan coordinate, the blue axis can point directly toward the pink point.
Edit: Besides the solution Yves gave, Jean also gave a geometrical interpretation and the solution below.
Rewrite the $p_{x/y}$ using polar coordinates (caution, $\pi$ is the polar argument, not the Archimedes constant).
$$\cos(t) (p \cos(\pi)\cos(s) + p\sin(\pi)\sin(s) ) + \sin(t)( p\sin(\pi)\cos(s) - p\cos(\pi)\sin(s) )\\= t_x \cos(s) + t_y \sin(s).$$
Then
$$\cos(t) p \cos(\pi-s) + \sin(t) p\sin(\pi-s) =t_x \cos(s) + t_y \sin(s),$$
$$\cos(t-\pi+s) = \frac{t_x \cos(s) + t_y \sin(s)}p$$
and
$$t=\pi-s\pm\arccos\left(\frac{t_x \cos(s) + t_y \sin(s)}p\right).$$