How to rotate one vector about another?

48.7k Views Asked by At

Brief
Given 2 non-parallel vectors: a and b, is there any way by which I may rotate a about b such that b acts as the axis about which a is rotating?

Question
Given: vector a and b
To find: vector c where c is produced by rotating a about b by an angle θ clockwise given by right hand thumb rule.
Edit: There is a problem with the image! it was supposed to be rotated clockwise by right hand thumb rule unlike how it is shown in the image (but there shouldn't be much of a difference in the solution). enter image description here

Right hand thumb rule: "Wrap the fingers of your right hand around vector b such that your thumb points in the direction of vector b. Then, the direction of curvature of the rest of your fingers will indicate the direction a will be rotated about b"

2

There are 2 best solutions below

3
On

Roughly speaking you want to do this :

  1. Start with $v_1 = b/|b|$ and extend it to an orthonormal basis $\{v_1, v_2, v_3\}$ of $\mathbb{R}^3$

  2. Write these vectors as columns of a matrix $P$ (notice that $P$ is invertible)

  3. Consider the matrix $B = PAP^{-1}$ where $$ A = \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos(\theta) & -\sin(\theta) \\ 0 & \sin(\theta) & \cos(\theta) \end{pmatrix} $$

  4. The vector you are looking for is $$ c = B(a) $$

3
On

A solution with quaternions:

Identify the quaternions with real part zero with vectors in $3$-space according to a Cartesian coordinate system: the $x$ axis becomes the coefficient for $i$, the $y$ axis for $j$ and the $z$ axis for $k$. In particular, we have quaternions $A=a_xi+a_yj+a_zk$ and $B=b_xi+b_yj+b_zk$ corresponding to the vectors $a=(a_x,a_y,a_z)$ and $b=(b_x,b_y,b_z)$.

Let $u$ be the quaternion $B$ normalized to unit length.

For your angle $\theta$ (measured in clockwise radians according to the right hand rule with $B$) compute $q=\cos(\theta/2)+u\sin(\theta/2)$.

The transformation $x\mapsto qxq^{-1}$ rotates the $3$-space of purely complex quaternions $\theta$ degrees clockwise around the axis presented by $u$ (which is the same as the axis $B$ gives). Keep in mind that $q^{-1}$ is just $\cos(\theta/2)-u\sin(\theta/2)$.

Notice that $qBq^{-1}=|B|quq^{-1}=|B|u=B$, showing that $B$ is the axis.

So to find out where $a$ is going, compute $qAq^{-1}$ and interpret the resulting quaternion as a vector in $3$-space.