1

私は2つのデカルト座標を持っています。xyzとBIG XYZがあります。これらを互いに平行にしたいのです。たとえば、x は X に平行、y は Y に平行、z は Z に平行です。私は回転行列を使用していますが、多くの異なる回転行列があります。たとえば、xyzデカルト座標に3Dポイントがあり、それはAと呼ばれ、デカルト座標をBIG XYZに変更し、この座標でBと呼ばれる同じ3Dポイントを見つけたいとします。今までは大丈夫です。しかし、別の回転行列を使用すると、ポイントが変更されました。私に何ができる?どのオイラー回転を使用できますか?

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 に答える