1

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

4

1 回答 1

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
于 2010-03-26T22:24:28.933 回答