% Rotation matrix according to Rodriguez see PCV (8.60) Usage: R = calc_Rot_rod(q) q - double 3x1, Rodriguez representation R - double 3x3, 3D rotation matrix Wolfgang Förstner wfoerstn@uni-bonn.de See also calc_R_from_opq_kraus, calc_r_phi_from_R, calc_Rot_ab, calc_Rot_q, calc_Rot_r, calc_Rot_rp, calc_Mq, calc_Mq_comm, calc_opq_from_R_Kraus
0001 %% Rotation matrix according to Rodriguez 0002 % see PCV (8.60) 0003 % 0004 % Usage: 0005 % R = calc_Rot_rod(q) 0006 % 0007 % q - double 3x1, Rodriguez representation 0008 % R - double 3x3, 3D rotation matrix 0009 % 0010 % Wolfgang Förstner 0011 % wfoerstn@uni-bonn.de 0012 % 0013 % See also calc_R_from_opq_kraus, calc_r_phi_from_R, calc_Rot_ab, 0014 % calc_Rot_q, calc_Rot_r, calc_Rot_rp, calc_Mq, calc_Mq_comm, calc_opq_from_R_Kraus 0015 0016 function R = calc_Rot_rod(q) 0017 0018 q1 = q(1)/2; 0019 q2 = q(2)/2; 0020 q3 = q(3)/2; 0021 0022 R = [ 0023 1+q1^2-q2^2-q3^2 2*(q1*q2-q3) 2*(q1*q3+q2); ... 0024 2*(q1*q2+q3) 1-q1^2+q2^2-q3^2 2*(q2*q3-q1); ... 0025 2*(q1*q3-q2) 2*(q2*q3+q1) 1-q1^2-q2^2+q3^2 ... 0026 ] ... 0027 /(1+q1^2+q2^2+q3^2); 0028 0029