1
$\begingroup$

How to find transformation matrix, specifically a rotation, between two given 3d vectors?

I've found something about it but with quaternions. I don't know anything about quaternions. So it would be great to find solutions in terms of vectors.

I mean rotation matrix.

  • 0
    Question body should not be a continuation of the title; it should be readable on its own. Also, proper capitalization is not optional.2014-08-14

1 Answers 1

2

I'm assuming you are asking that given $\vec{x} = (x_k)_{k=1}^3, \vec{y} = (y_k)_{k=1}^3 \in \mathbb{R}^3$, how do you find $A = (a_{i,j})_{i,j=1}^3 \in \mathbb{R}^{3 \times 3}$ so that $A \vec{x} = \vec{y}$.

In case $\{x_i\}_{i=1}^3$ are all non-zero, a simple diagonal matrix would do: define $a_{i,i} = y_i/x_i$ and let all off-diagonal elements be $0$.

If exactly one of the elements of $\vec{x}$ are zero, say $x_1 = 0$ then let $a_{1,1} = 0$ and $a_{1,2} = y_1/x_2$, leving the rest at 0.

If two of the elements of $\vec{x}$ are zero, say $x_1 = x_3 = 0$, define $a_{1,1} = a_{3,3} = 0$, $a_{1,2}$ as above, and $a_{3,2} = y_3/x_2$ to get what you need.

Finally, if $\vec{x} = \vec{0}$, it is not possible unless $\vec{y} = 0$ as well.