Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Question about 3D rotation

2 Ansichten (letzte 30 Tage)
Jiali
Jiali am 20 Mai 2020
Geschlossen: Jiali am 5 Jun. 2020
I tried to rotate a sequence of points in the below sequence:
first-axis: Z, rotation angle is 45 degree; second-axis: X, rotation angle is 30 degree; third-axis:Y, rotation angle is 0 degree.
In my opinion, the above coordinate transformation is equivalent with the spherical coordinate with theta 45 degree and phi 30 degree. However, when I use the dcm2angle, the value of theta is -45 degree and the value of phi is -30 degree. I am really confused about it since I believe that they should be equal. Could you please help me out? Thanks a lot.
clear all;
[X,Y,Z]=ndgrid([-1:0.5:1],[-3:1:3],[-2:0.4:2]);
a=[X(:),Y(:),Z(:)];
a=a.';
R1=rotz(45);
R2=rotx(30);
R3=roty(0);
dcm=R3*R2*R1;
% new coordinate
anew=dcm*a;
figure;scatter3(a(1,:,:),a(2,:,:),a(3,:,:));
hold on;
scatter3(anew(1,:,:),anew(2,:,:),anew(3,:,:));
% the calculation of theta and phi
[pitch,roll,yaw]=dcm2angle(dcm,'ZXY');
pitch=pitch*180/pi;
roll=roll*180/pi;

Antworten (0)

Diese Frage ist geschlossen.

Produkte


Version

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by