0
$\begingroup$

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?

$\endgroup$
  • 1
    $\begingroup$ Try Inverse[{{-1, 1, -1}, {1, 1, 0}, {-1, 1, 2}}] $\endgroup$ – LouisB Jan 22 '18 at 9:37
  • $\begingroup$ $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}? $\endgroup$ – Myridium Jan 22 '18 at 10:17
  • 1
    $\begingroup$ The three vectors have to be normalized before Inverse[] is applied. $\endgroup$ – Ulrich Neumann Jan 22 '18 at 10:23
1
$\begingroup$

Does

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

do what you seek for?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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