Rotation question. Trigonometry equation.

82 Views Asked by At

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.

physical problem

end goal


Edit: Besides the solution Yves gave, Jean also gave a geometrical interpretation and the solution below.

2

There are 2 best solutions below

4
On BEST ANSWER

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).$$

1
On

Let me give a more geometrical solution.

Let us write your equation under the following matrix form :

$$\underbrace{\begin{pmatrix}\cos(t)&\sin(t)\end{pmatrix}\begin{pmatrix}p_x&p_y\\p_y&-p_x\end{pmatrix}}_{V_1^T}\underbrace{\begin{pmatrix}\cos(s)\\\sin(s)\end{pmatrix}}_V =\underbrace{\begin{pmatrix}t_x&t_y\end{pmatrix}}_{V_2^T}\underbrace{\begin{pmatrix}\cos(s)\\\sin(s)\end{pmatrix}}_V$$

meaning that $V_1$ and $V_2$ have the same dot product with $V$.

Therefore,

$$V_1=V_2+kW\ \ \text{where} \ \ W:=\binom{\ \ \sin(s)}{-\cos(s)}\tag{1} $$

is a vector n orthogonal to $V$ and $k$ any real number.

(with words : $V_1$ and $V_2$ differ by a multiple of vector $W$).

As, by transposition, $V_1=\underbrace{\begin{pmatrix}p_x&p_y\\p_y&-p_x\end{pmatrix}}_M\begin{pmatrix}\cos(t)\\\sin(t)\end{pmatrix}$, relationship (1) becomes :

$$\begin{pmatrix}\cos(t)\\\sin(t)\end{pmatrix}=M^{-1}(V_2+kW)=a M(V_2+kW) \ \ \text{where} \ \ a:=\frac{1}{p_x^2+p_y^2}\tag{2}$$

Therefore, (2) can be explicited in the following way:

$$\begin{cases}\cos(t)&=&a(t_x+k\sin(s))p_x+a(t_y-k \cos(s))p_y\\ \sin(t)&=&a(t_x+k\sin(s))p_y-a(t_y-k \cos(s))p_x\end{cases}\tag{3}$$

In fact, parameter $k$ can be found out of these equations by writing... $\cos(t)^2+\sin(t)^2=1$.

Using (3), one gets at once the value of $t$.

The interest of this solution (sophisticated, I admit...) is to give a method of attack of such problems that can be usable in other circumstances.