calcTmn.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. t2 = cos(gPsi);
  2. t3 = sin(gTheta);
  3. t4 = cos(gTheta);
  4. t5 = sin(gPhi);
  5. t6 = sin(gPsi);
  6. t7 = q0*q0;
  7. t8 = q1*q1;
  8. t9 = q2*q2;
  9. t10 = q3*q3;
  10. t11 = t7+t8-t9-t10;
  11. t12 = q0*q2*2.0;
  12. t13 = q1*q3*2.0;
  13. t14 = t12+t13;
  14. t15 = cos(gPhi);
  15. t16 = q0*q3*2.0;
  16. t18 = q1*q2*2.0;
  17. t17 = t16-t18;
  18. t19 = t2*t3;
  19. t20 = t4*t5*t6;
  20. t21 = t19+t20;
  21. t22 = t2*t4;
  22. t34 = t3*t5*t6;
  23. t23 = t22-t34;
  24. t24 = t4*t6;
  25. t25 = t2*t3*t5;
  26. t26 = t24+t25;
  27. t27 = t16+t18;
  28. t28 = t3*t6;
  29. t35 = t2*t4*t5;
  30. t29 = t28-t35;
  31. t30 = q0*q1*2.0;
  32. t33 = q2*q3*2.0;
  33. t31 = t30-t33;
  34. t32 = t7-t8+t9-t10;
  35. t36 = t7-t8-t9+t10;
  36. t37 = t12-t13;
  37. t38 = t30+t33;
  38. A0[0][0] = t11*t23+t14*t21+t6*t15*t17;
  39. A0[0][1] = t11*t26+t14*t29-t2*t15*t17;
  40. A0[0][2] = -t5*t17-t3*t11*t15+t4*t14*t15;
  41. A0[1][0] = t23*t27-t21*t31-t6*t15*t32;
  42. A0[1][1] = t26*t27-t29*t31+t2*t15*t32;
  43. A0[1][2] = t5*t32-t3*t15*t27-t4*t15*t31;
  44. A0[2][0] = t21*t36-t23*t37-t6*t15*t38;
  45. A0[2][1] = -t26*t37+t29*t36+t2*t15*t38;
  46. A0[2][2] = t5*t38+t3*t15*t37+t4*t15*t36;