Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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.

share|cite|improve this question

marked as duplicate by Jonas Meyer, Ivo Terek, ᴡᴏʀᴅs, TooTone, hardmath Aug 14 '14 at 23:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Do you mean to ask, given $\vec{a}, \vec{b} \in \mathbb{R}^3$, find $A$ s.t. $A \vec{a} = \vec{b}$? – gt6989b Oct 31 '12 at 16:09
@gt6989b, yes i mean exactly this – Yola Apr 9 '13 at 9:42
Question body should not be a continuation of the title; it should be readable on its own. Also, proper capitalization is not optional. – ᴡᴏʀᴅs Aug 14 '14 at 22:59
up vote 2 down vote accepted

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.

share|cite|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.