1 function R = Rpy2Rot(rpy)
3 % Rotation matrix from body-fixed frame to inertial frame in roll-pitch-yaw
6 % function R = Rpy2Rot(rpy)
9 % rpy dim 3x1 roll-pitch-yaw angles
12 % R dim 3x3 Rotation matrix
14 % G. Antonelli, Simurv 4.0, 2013
21 cp = cos(psi); sp = sin(psi);
22 ct = cos(theta); st = sin(theta);
23 cf = cos(phi); sf = sin(phi);
25 R = [ cp*ct -sp*cf+cp*st*sf sp*sf+cp*cf*st
26 sp*ct cp*cf+sf*st*sp -cp*sf+st*sp*cf