0
$\begingroup$

I have a point at 2d space in only positive x and y axis, point P(x1, y1) is rotated along axis point C(x3, y3) to reach at point P2(x2, y2).

Now I just need to calculate the angle of rotation.

If possible please share simplified formula along with the details.

Refer this image provided for clarity

Thanks

$\endgroup$
  • $\begingroup$ Make sense thanks. Could you put this on answer so i could upVote it $\endgroup$ – DeWy Sady Jun 28 '16 at 13:47
0
$\begingroup$

$$\arctan_2(y_2-y_c,x_2-x_c)-\arctan_2(y_1-y_c,x_1-x_c)$$

$\endgroup$
0
$\begingroup$

Hint:

Take the two vectors: $$ \vec p_1=P_1C=(x_1-x_3,y_1-y_3)^T \qquad \vec p_2=P_2C=(x_2-x_3,y_2-y_3)^T $$

do you know that the dot product of these vectors is: $$ \vec p_1 \cdot \vec p_2=|\vec p_1||\vec p_2| \cos \theta$$ where $ \theta$ is the angle between the two vectors?


$$ \vec p_1 \cdot \vec p_2=(x_1-x_3)(x_2-x_3)+(y_1-y_3)(y_2-y_3) $$ $$ |\vec p_1 |=\sqrt{(x_1-x_3)^2+(y_1-y_3)} $$ $$ |\vec p_2 |=\sqrt{(x_2-x_3)^2+(y_2-y_3)} $$ $$ \theta=\arccos\left(\frac{\vec p_1 \cdot \vec p_2}{|\vec p_1||\vec p_2|} \right) $$

$\endgroup$
  • $\begingroup$ I need a formula to calculate the θ. This I know but since i am not in touch with math since 6 years i need simplified version. With simplified I mean in not in vector form $\endgroup$ – DeWy Sady Jun 28 '16 at 13:25
  • $\begingroup$ Use the componets of the vectors as I've added to my answer. $\endgroup$ – Emilio Novati Jun 28 '16 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.