Calculate the $X$, $Y$ and $Z$ rotations from one vector to another

124 Views Asked by At

If I have a $3$ vectors representing the $X$, $Y$ and $Z$ Axis of an object how would I calculate the rotations needed to get to that point from its original position of \begin{align} \text{$X$-axis Vector} &= {1,0,0} \\ \text{$Y$-axis Vector} &= {0,1,0} \\ \text{$Z$-axis Vector} &= {0,0,1} \end{align} By the rotations needed I mean the individual rotations around the $X$, $Y$ and $Z$-axis.

1

There are 1 best solutions below

2
On BEST ANSWER

Let the three vectors be $b_1$, $b_2$, $b_3$ then we need to find the transformation matrix $T$ with $$ b_i = T e_i \quad (i \in \{1,2,3\}) $$ This leads to a matrix equation $$ B = T I $$ where $B = (b_1, b_2, b_3)$ consisting of column vectors $b_i$ and $I$ is the identity matrix. This reduces to $$ T = B $$ If $T$ is the matrix of a rotation the property $$ \mbox{det } T = 1 $$ is required. As $T=B$ this depends on the given $B$ and will not always be true for arbitrary $b_i$.