calcTmn.m 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. function Tmn = calcTmn(gPhi,gPsi,gTheta,q0,q1,q2,q3)
  2. %CALCTMN
  3. % TMN = CALCTMN(GPHI,GPSI,GTHETA,Q0,Q1,Q2,Q3)
  4. % This function was generated by the Symbolic Math Toolbox version 6.1.
  5. % 15-Feb-2015 16:02:10
  6. t2 = cos(gPsi);
  7. t3 = sin(gTheta);
  8. t4 = cos(gTheta);
  9. t5 = sin(gPhi);
  10. t6 = sin(gPsi);
  11. t7 = q0.^2;
  12. t8 = q1.^2;
  13. t9 = q2.^2;
  14. t10 = q3.^2;
  15. t11 = t7+t8-t9-t10;
  16. t12 = q0.*q2.*2.0;
  17. t13 = q1.*q3.*2.0;
  18. t14 = t12+t13;
  19. t15 = cos(gPhi);
  20. t16 = q0.*q3.*2.0;
  21. t18 = q1.*q2.*2.0;
  22. t17 = t16-t18;
  23. t19 = t2.*t3;
  24. t20 = t4.*t5.*t6;
  25. t21 = t19+t20;
  26. t22 = t2.*t4;
  27. t34 = t3.*t5.*t6;
  28. t23 = t22-t34;
  29. t24 = t4.*t6;
  30. t25 = t2.*t3.*t5;
  31. t26 = t24+t25;
  32. t27 = t16+t18;
  33. t28 = t3.*t6;
  34. t35 = t2.*t4.*t5;
  35. t29 = t28-t35;
  36. t30 = q0.*q1.*2.0;
  37. t33 = q2.*q3.*2.0;
  38. t31 = t30-t33;
  39. t32 = t7-t8+t9-t10;
  40. t36 = t7-t8-t9+t10;
  41. t37 = t12-t13;
  42. t38 = t30+t33;
  43. Tmn = reshape([t11.*t23+t14.*t21+t6.*t15.*t17,t23.*t27-t21.*t31-t6.*t15.*t32,t21.*t36-t23.*t37-t6.*t15.*t38,t11.*t26+t14.*t29-t2.*t15.*t17,t26.*t27-t29.*t31+t2.*t15.*t32,-t26.*t37+t29.*t36+t2.*t15.*t38,-t5.*t17-t3.*t11.*t15+t4.*t14.*t15,t5.*t32-t3.*t15.*t27-t4.*t15.*t31,t5.*t38+t3.*t15.*t37+t4.*t15.*t36],[3, 3]);