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
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
Copyright © 2021 JogjaFile Inc.
In principle, you can, but it might be more work than you bargained for :
Normalize $\vec{v_1} = (x,y,z)$ to assume that $\|\vec{v_1}\| = 1$.
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)
Choose an orthonormal basis $\{\vec{v_2}, \vec{v_3}\}$ of $P$.
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$
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).
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.