calcG.m 753 B

123456789101112131415161718
  1. function G = calcG(q0,q1,q2,q3)
  2. %CALCG
  3. % G = CALCG(Q0,Q1,Q2,Q3)
  4. % This function was generated by the Symbolic Math Toolbox version 5.8.
  5. % 14-Jan-2015 11:09:06
  6. t2 = q0.*(1.0./2.0);
  7. t3 = q2.*(1.0./2.0);
  8. t4 = q1.*q2.*2.0;
  9. t5 = q0.^2;
  10. t6 = q1.^2;
  11. t7 = q2.^2;
  12. t8 = q3.^2;
  13. t9 = q0.*q2.*2.0;
  14. t10 = q1.*q3.*2.0;
  15. t11 = q2.*q3.*2.0;
  16. G = reshape([q1.*(-1.0./2.0),t2,q3.*(1.0./2.0),-t3,0.0,0.0,0.0,0.0,0.0,0.0,q2.*(-1.0./2.0),q3.*(-1.0./2.0),t2,q1.*(1.0./2.0),0.0,0.0,0.0,0.0,0.0,0.0,q3.*(-1.0./2.0),t3,q1.*(-1.0./2.0),t2,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,t5+t6-t7-t8,t4+q0.*q3.*2.0,-t9+t10,0.0,0.0,0.0,0.0,0.0,0.0,0.0,t4-q0.*q3.*2.0,t5-t6+t7-t8,t11+q0.*q1.*2.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,t9+t10,t11-q0.*q1.*2.0,t5-t6-t7+t8,0.0,0.0,0.0],[10, 6]);