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)
Ältere Kommentare anzeigen
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;
0 Kommentare
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!