Lecture Position Orientation
Lecture Position Orientation
Rx = rotx(pi/2); % or R = rotx(90,'deg');
% Rotation about y by angle theta=-60 deg:
Ry = roty(-pi/3); % or R = roty(-60,'deg');
% Rotation about z by angle theta=45 deg:
Rz = rotz(pi/4); % or R = rotz(45,'deg');
% To do successive basic rotations:
R = rotx(30,'deg')*roty(45,'deg');
% To plot the rotated coordinate:
figure(2);
trplot(R);
% To animate the rotation:
tranimate(R);