CL_rot_angles2matrix — Rotation angles matrix
M = CL_rot_angles2matrix(axes,angles)
vecteur with rotations order (1xN, Nmax = 3 ).
Euler angles (NxP, Nmax = 3 ) [rad]
frame matrix. If N = 1, and P=1 M is a (3x3) matrix; if P>1 , M is a (3x3xP) hypermatrix.
axes =[1],angles =[a],M=CL_rot_angles2matrix(axes,angles) -> M' is a rotation of 'a' on axe 1
axes =[2],angles =[a],M=CL_rot_angles2matrix(axes,angles) -> M' is a rotation of 'a' on axe 2
axes =[3],angles =[a],M=CL_rot_angles2matrix(axes,angles) -> M' is a rotation of 'a' on axe 3
axes =[1,2],angles =[a;b],M=CL_rot_angles2matrix(axes,angles) -> M=CL_rot_angles2matrix(2,b)*CL_rot_angles2matrix(1,a)
axes =[1,2,3],angles =[a;b;c],M=CL_rot_angles2matrix(axes,angles) -> M=CL_rot_angles2matrix(3,c)*CL_rot_angles2matrix(2,b)*CL_rot_angles2matrix(1,a)
axes =[3,2,3],angles =[a;b;c],M=CL_rot_angles2matrix(axes,angles) -> M=CL_rot_angles2matrix(3,c)*CL_rot_angles2matrix(2,b)*CL_rot_angles2matrix(3,a)
For example: if R is a reference frame and S a satellite frame issued from successive rotations angles =[a,b,c] then the coordinates of a unique vector v (with coordinates vR in R and vS in S) are linked by:
M = CL_rot_angles2matrix([1],[30*%pi/180]) M = CL_rot_angles2matrix([1,2],[%pi/3;%pi/2]) M = CL_rot_angles2matrix([1,2,3],[%pi/6;%pi/2;%pi/4]) //R is a reference frame; S is a frame obtained from R with a rotation of 10 deg on the Z axis ang = CL_deg2rad(10) M = CL_rot_angles2matrix([3],ang) vR = [1;0;0] //X axis of the R reference frame expressed on the R reference frame vS = M*vR //vS is the X axis of R expressed on the S frame wR = M'*vR //wR is vector vR rotated 10 deg on the Z axis, all expressed on the R reference frame