Find rotation matrix of vector rotated around a point

488 Views Asked by At

Given a unit vector $a$ and a point $(x,y,z)$ if I rotate $a$ around $(x,y,z)$ I get the vector $b$. My question is, given $a$, $b$ and $(x,y,z)$ can I recover the rotation matrix used to rotate $a$ around $(x,y,z)$ to get $b$?

Thanks

1

There are 1 best solutions below

2
On

In principle, you can, but it might be more work than you bargained for :

  1. Normalize $\vec{v_1} = (x,y,z)$ to assume that $\|\vec{v_1}\| = 1$.

  2. Choose the plane $P$ such that $\vec{v_1} \perp P$ and $\vec{a},\vec{b} \in P$ (Note: This must be possible for such a transformation to exist)

  3. Choose an orthonormal basis $\{\vec{v_2}, \vec{v_3}\}$ of $P$.

  4. Find an orthogonal matrix $O$ such that $O(\vec{v_i}) = \vec{e_i}$, where $\{\vec{e_i}\}$ is the standard basis for $\mathbb{R}^3$

  5. Now, write $\vec{c} := O(\vec{a}), \vec{d} := O(\vec{b})$, which must lie in the $Y-Z$ plane. Thinking of these vectors as lying in $\mathbb{R}^2$, you can find $\theta \in [0,2\pi]$ such that rotating $\vec{c}$ by $\theta$ radians will give $\vec{d}$ (This can be done either by inspection, or by writing down some equations involving the coordinates of these vectors).

  6. Now consider the matrix $$ A:= O\begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos(\theta) & -\sin(\theta) \\ 0 & \sin(\theta) & \cos(\theta) \end{pmatrix} O^{-1} $$ This matrix should do what you want.