Home > classes > @ssm > T_ZYX_rot.m

T_ZYX_rot

PURPOSE ^

builds the direction cosine matrix out of an input vector containing the cardan angles

SYNOPSIS ^

function direction_cosine = T_ZYX_rot(vector)

DESCRIPTION ^

builds the direction cosine matrix out of an input vector containing the cardan angles
[alpha beta gamma] for a ZYX-rotation sequence (->first rotation around
z-axes(gamma), second around new y-axes(beta), and last rotation around new x-axes(alpha)(

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function direction_cosine = T_ZYX_rot(vector)
0002 %builds the direction cosine matrix out of an input vector containing the cardan angles
0003 %[alpha beta gamma] for a ZYX-rotation sequence (->first rotation around
0004 %z-axes(gamma), second around new y-axes(beta), and last rotation around new x-axes(alpha)(
0005 sizeV = size(vector);
0006 if (sum(sizeV)==4 && ( ( sizeV(1)==1 && sizeV(2)==3 ) || ( sizeV(2)==1 && sizeV(1)==3 ) ) )
0007     alpha = vector(1); beta = vector(2);  gamma = vector(3);
0008     
0009     direction_cosine = [ cos(beta)*cos(gamma)                                    cos(beta)*sin(gamma)                                    -sin(beta)          ;...
0010                          sin(alpha)*sin(beta)*cos(gamma)-cos(alpha)*sin(gamma)   sin(alpha)*sin(beta)*sin(gamma)+cos(alpha)*cos(gamma)   sin(alpha)*cos(beta);...
0011                          cos(alpha)*sin(beta)*cos(gamma)+sin(alpha)*sin(gamma)   cos(alpha)*sin(beta)*sin(gamma)-sin(alpha)*cos(gamma)   cos(alpha)*cos(beta)];
0012                      
0013 else
0014     display('the input vector for convertion is:');
0015     display(Vector);
0016     error('Vector for convertion is not a 3*1 nor a 1*3 matrix (see line above)!');
0017 end
0018 end

Generated on Wed 27-Aug-2008 13:30:29 by m2html © 2003