# Calculation of the desired Rotation Matrix

Here I have three orthogonal vectors, {-1,1,-1} {1,1,0} {-1,1,2}, and I want to obtain the rotation matrix which can transform these three vectors into {1,0,0} {0,1,0} {0,0,1}, respectively. Therefore, I tried:

Solve[{RotationMatrix[x1, {y1, y2, y3}].({-1, 1, -1}/
Norm[{-1, 1, -1}]) == {1, 0, 0},
RotationMatrix[x1, {y1, y2, y3}].({1, 1, 0}/Norm[{1, 1, 0}]) == {0, 1, 0},
RotationMatrix[x1, {y1, y2, y3}].({-1, 1, 2}/
Norm[{-1, 1, 2}]) == {0, 0, 1}}, {x1, y1, y2, y3}]


and

Solve[{EulerMatrix[{y1, y2, y3}].({-1, 1, -1}/
Norm[{-1, 1, -1}]) == {1, 0, 0},
EulerMatrix[{y1, y2, y3}].({1, 1, 0}/Norm[{1, 1, 0}]) == {0, 1, 0},
EulerMatrix[{y1, y2, y3}].({-1, 1, 2}/Norm[{-1, 1, 2}]) == {0, 0, 1}},
{y1, y2, y3}]


but neither of them works.

Can anyone help me to get the desired rotation matrix?

• Try Inverse[{{-1, 1, -1}, {1, 1, 0}, {-1, 1, 2}}] – LouisB Jan 22 '18 at 9:37
• $0$ is a fixed point of this matrix, meaning that if it's a rotation, then it preserves the magnitude of vectors. So how can {-1,1,-1} be mapped to {1,0,0}? – Myridium Jan 22 '18 at 10:17
• The three vectors have to be normalized before Inverse[] is applied. – Ulrich Neumann Jan 22 '18 at 10:23

## 1 Answer

Does

frame = {{-1, 1, -1}, {1, 1, 0}, {-1, 1, 2}};
A = Orthogonalize[Transpose[frame]]


do what you seek for?

• From here, one can use any of the methods in this thread to find the axis-angle representation of the rotation matrix. – J. M. is in limbo Mar 20 '18 at 3:10