I have two vectors, $v$ and $u$. How do I rotate $u$ around the x-, y-, and z-axes (or one axis) so that it points in the same direction as $v$?
|
|
If $u,v\in\mathbb R^2$, Find the angle between $u$ and $v$ by $$\cos\theta=\frac{<u,v>}{|u|.|v|}$$ Now take matrix of rotation $A_\theta$ of angle $\theta$. Now take $A_\theta u$ or $A_{-\theta} u$. These will rotate $u$ to the direction of $v$. $$A_\theta= \left( \begin{array}{cc} \cos\theta &-\sin\theta \\ \sin\theta &\cos\theta \\ \end{array} \right) $$ For $u,v\in \mathbb R^3$, If some of x,y,z is zero, then case reduces to $\mathbb R^2$ keeping one axis fixed. Example: Assume $u= (1,2,3)$ and $v= (2,-5,6)$ Then rotation matrix which take $u$ to $v$ is $\left( \begin{array}{ccc} \frac{2}{1} &0 & 0 \\ 0 &\frac{-5}{2} &0 \\ 0 & 0 &\frac{6}{3}\\ \end{array} \right)= $ $\left( \begin{array}{ccc} 2 &0 & 0 \\ 0 &\frac{-5}{2} &0 \\ 0 & 0 &2 \\ \end{array} \right)$ putting value of $a,b,c$ and $x,y,z $ you may have many more example.... If some of $x,y,z$ is what happen see and if didn't get comment it.. i will give example for that too. |
|||||||||||
|
|
I believe this article can help: Arbitrary Axis Rotation |
|||
|
|
Two 3-vectors define a plane. Rotation in that plane (i.e. about normal vector of that plane) brings one vector to another. So the quick sketch for the solution would be:
I am curious if someone expresses the straightforward formula here... |
||||
|
|