I am trying to find a Direction Cosine Matrix (DCM) for the Euler angle body 1-2-3 sequence. I tried making my own function and using the MATLAB function, but the result is a matrix that is transpose of each other. I mean that transpose(EA123toDCM) = E123toDCM. Why is that? Also, for the E123toDCM line, I am using the sequence 'ZYX'. Is that correct or should it be 'XYZ'? I know that that for a DCM of sequence 1-2-3 = R3(theta1)*R2(theta2)*R1(theta3). Is ZYX sequence the same as a 1-2-3 sequence? EA = [pi/3; -pi/4; -pi/6]; EA123toDCM = EA123DCM(EA) E123toDCM = angle2dcm(EA(1,1), EA(2,1), EA(3,1), 'ZYX') function [R] = EA123DCM(EA) theta1 = EA(1,1); theta2 = EA(2,1); theta3 = EA(3,1); R1 = @(a)[1 0 0 ; 0 cos(a) -sin(a); 0 sin(a) cos(a)]; R2 = @(a)[cos(a) 0 sin(a) ; 0 1 0 ; -sin(a) 0 cos(a)]; R3 = @(a)[ cos(a) -sin(a) 0; sin(a) cos(a) 0; 0 0 1]; R = R3(theta1)*R2(theta2)*R1(theta3); end
I am trying to find a Direction Cosine Matrix (DCM) for the Euler angle body 1-2-3 sequence. I tried making my own function and using the MATLAB function, but the result is a matrix that is transpose of each other. I mean that transpose(EA123toDCM) = E123toDCM. Why is that?
Also, for the E123toDCM line, I am using the sequence 'ZYX'. Is that correct or should it be 'XYZ'? I know that that for a DCM of sequence 1-2-3 = R3(theta1)*R2(theta2)*R1(theta3). Is ZYX sequence the same as a 1-2-3 sequence?
EA = [pi/3; -pi/4; -pi/6];
EA123toDCM = EA123DCM(EA)
E123toDCM = angle2dcm(EA(1,1), EA(2,1), EA(3,1), 'ZYX')
function [R] = EA123DCM(EA)
theta1 = EA(1,1);
theta2 = EA(2,1);
theta3 = EA(3,1);
R1 = @(a)[1 0 0 ;
0 cos(a) -sin(a);
0 sin(a) cos(a)];
R2 = @(a)[cos(a) 0 sin(a) ;
0 1 0 ;
-sin(a) 0 cos(a)];
R3 = @(a)[ cos(a) -sin(a) 0;
sin(a) cos(a) 0;
0 0 1];
R = R3(theta1)*R2(theta2)*R1(theta3);
end

Trending now
This is a popular solution!
Step by step
Solved in 3 steps









