Given two nonzero 3-vectors $\vec{u}$ and $\vec{v}$ of equal length, does there always exist a 3×3 matrix M such that $\vec{u}=M\vec{v}$ of this form

3dlinear algebravectors

I originally wanted to derive a general rotation matrix that can transform a given 3-vector into another specified 3-vector of equal length. In failing to do so, I derived a matrix that contains information about the axis and angle of rotation. I wanted to share my matrix and ask for confirmation that such a matrix can always be found for two equal length nonzero 3-vectors.

Although my matrix is not a rotation matrix, I find my matrix to be valuable for its ease of use, especially in comparison to the standard method, or Rodrigues' rotation formula.

Let $\vec{u} = (x,y,z), \vec{v}=(p,q,r)$ .
Then the relationship between $\vec{u}$ and $\vec{v}$ can be expressed as
$$
\frac{1}{d}
\begin{bmatrix} d\cos\theta & -c\sin\theta & b\sin\theta \\c\sin\theta & d\cos\theta & -a\sin\theta \\\ -b\sin\theta & a\sin\theta & d\cos\theta\end{bmatrix}
\begin{bmatrix} p \\\ q \\\ r\end{bmatrix}=\begin{bmatrix} x\\y\\z\end{bmatrix}
$$

where $d=\sqrt{a^2+b^2+c^2}$, $(a,b,c)$ is orthogonal to the plane containing $\vec{u}$ and $\vec{v}$, and $\theta$ is the angle between $\vec{u}$ and $\vec{v}$.

My derivation is as follows:

Let $\vec{v}=(p,q,r)$ be a non-zero 3-vector. Pick a unit vector $\vec{a}=(a,b,c)$ orthogonal to it.

Then $(x,y,z)=\vec{v}\cos(\theta)+\vec{a}$x$\vec{v}\sin(\theta)$

So

$
\begin{bmatrix} p\cos(\theta) \\\ q\cos(\theta) \\\ r\cos(\theta)\end{bmatrix}+
\begin{bmatrix} (br-cq)\sin(\theta) \\\ (cp-ar)\sin(\theta)\\\ (aq-bp)\sin(\theta)\end{bmatrix}=\begin{bmatrix} x\\y\\z\end{bmatrix}
$

I should add that since learning about Rodrigues' rotation formula I now understand how to derive the general rotation matrix that I originally set out to derive.

Best Answer

The standard method to find a rotation matrix that rotates a vector $u$ into $v$ is:

Take as rotation

  • axis $\omega$ the cross product between $u$ and $v\,,$

  • angle $\theta$ the angle between $u$ and $v\,.$

Form the cross product matrix $K$ of $\omega\,.$

Write the rotation matrix as $$ R = I + (\sin\theta) K+(1-\cos\theta)K^2\,. $$

  • Your favourite matrix in OP is not a rotation matrix because its determinant is $\color{red}{\cos\theta}$ which is not always one.

  • To check if your matrix really maps $\vec{v}$ into $\vec{u}$ let's assume for simplicity that these vectors have length one. The rotation axis is the cross product $\vec{v}\times\vec{u}\,:$ $$ \begin{pmatrix}a\\b\\c\end{pmatrix}= \begin{pmatrix}p\\q\\r\end{pmatrix}\times \begin{pmatrix}x\\y\\z\end{pmatrix}= \begin{pmatrix}qz-ry\\ rx-pz\\ py-qx \end{pmatrix} $$ whose length $d$ is $\sin\theta\,.$ Thus, $\frac{\sin\theta}{d}=1\,.$ We also use the scalar product $\vec{v}\cdot\vec{u}\,:$ $$ \cos\theta=xp+yq+zr\,. $$ Let's call your matrix $M\,.$ Then $M\vec{v}$ has the first component \begin{align}\require{cancel} p\cos\theta-c\,q+b\,r&=xp^2+\cancel{ypq+zpr}+xq^2\cancel{-ypq-zpr}+xr^2\\ &=x(p^2+q^2+r^2)=x\,. \end{align} The other components are verified similarly.

  • Conclusion: Your matrix maps two particular vectors $\vec{v},\vec{u}$ into each other but is neither a rotation nor a reflection. In particular it is not length preserving and not angle preserving.

  • To figure out what matrix $M$ is we assume w.l.o.g. that $\vec{u},\vec{v}$ are in the $xy$-plane. Then their cross product is $$ \begin{pmatrix}0\\0\\\sin\theta\end{pmatrix} $$ and the matrix simplifies to $$ M=\begin{pmatrix} \cos\theta &-\sin\theta&0\\ \sin\theta&\cos\theta&0\\ 0&0&\color{red}{\cos\theta}\end{pmatrix}\,. $$ This is obviously a rotation around the $z$-axis by the angle $\theta$ followed (or preceded) by a compression of the $z$-direction by the factor $\color{red}{\cos\theta}\,.$

Related Question