Info
此问题已关闭。 请重新打开它进行编辑或回答。
Question about 3D rotation
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!