Rotation matrix to move to a different basis

104 Views Asked by At

I have three unit vectors x', y', and z' in R^3.

I wish to calculate a 3x3 rotation matrix M such that:

M x [1,0,0] -> x'
M x [0,1,0] -> y'
M x [0,0,1] -> z'

How can I generate M from the new unit vectors?

1

There are 1 best solutions below

1
On

You wrote in the comment that you choose the vectors as follows $$ y'=x'\times\left(\begin{matrix}0\\0\\1\end{matrix}\right)=\left(\begin{matrix}x'_2\\-x'_1\\0\end{matrix}\right)\,,\quad z'=x'\times y'=\left(\begin{matrix}x_1'x_3'\\x_2'x_3'\\-(x_1')^2-(x_2')^2\end{matrix}\right) $$ The columns of $$ M=(x',y',z') $$ are orthogonal but not normalized (except $x'$ by your choice). For $M$ to be a rotation matrix the determinant must be $+1\,.$ With unnormalized $y',z'$ the determinant is \begin{align} {\rm det}(M)&=(x_1')^4+(x_1')^2(x_2')^2+(x_2')^2(x_3')^2+(x_1')^2(x_3')^2+(x_2')^4+(x_1')^2(x_2')^2\\[3mm] &=((x_1')^2+(x_2')^2)^2+((x_1')^2+(x_2')^2)(x_3')^2\,,\\[3mm] &=((x_1')^2+(x_2')^2)\underbrace{((x_1')^2+(x_2')^2+(x_3')^2)}_{||x'||^2=1}\,. \end{align} From $||y'||=\sqrt{(x_1')^2+(x_2')^2}$ it follows that $$ ||z'||=||y'|| $$ so that ${\det}(M)=||y'||\,||z'||\,.$ This shows that the determinant will be one once $y'$ and $z'$ are normalized.

The rotation angle $\alpha$ is the angle between $(0,1,0)^\top$ and its image $y'\,.$ This is $$ \alpha=\arccos\left(\frac{-(x_1')^2}{\sqrt{(x_1')^2+(x_2')^2}}\right)\,. $$