我可以使用哪种转子旋转?

时间:2010-03-26 14:13:59

标签: math matrix euler-angles

我有两个笛卡尔坐标。有xyz和BIG XYZ。我想让它们相互平行。例如,x对应X,y平行于Y,z平行于Z.我使用旋转矩阵,但我有很多不同的旋转矩阵。例如,我在xyz笛卡尔坐标中有3D点,它被称为A,我想将笛卡尔坐标更改为BIG XYZ,并在此坐标中找到相同的3D点,称为B.直到现在它还可以。但是当我使用不同的旋转矩阵时,点数发生了变化。我能做什么?我可以使用哪种Euler旋转?

1 个答案:

答案 0 :(得分:1)

这是你在找什么?

% an orthonormal base ('old')
x = [1; 0; 0];
y = [0; 1; 0];
z = [0; 0; 1];

% orthogonal (=rotation) matrix having this base as its columns
Rold = [x, y, z]; 

% another orthonormal base ('new')
X = [1;  1; 0]/sqrt(2);
Y = [-1; 1; 1]/sqrt(3);
Z = [1; -1; 2]/sqrt(6);

% orthogonal matrix having this basis as its columns
Rnew = [X, Y, Z]; 

% a "point" (indeed a vector; coordinates are with respect to the 'old' base,
% so this is actually the point 1*x + 2*y + 3*z)
A = [1; 2; 3]

% point = [x y z] A = [x y z] |1| = [X Y Z] |p| = [X Y Z] B
%                             |2|           |q|
%                             |3|           |r|
% where p,q,r are the unknown coordinates in the 'new' base
% To find them, just multiply by the inverse (=transpose) of [X Y Z]
B = Rnew'*Rold*A

% Rnew'*Rold, i.e. transpose(Rnew)*Rold is the rotation you are searching