C+ C NAME: C qmultiply C PURPOSE: C multiply two quaternions together C CATEGORY: C Math C CALLING SEQUENCE: C call qmultiply(Q1, Q2, Q) C INPUTS: C Q1(4) real quaternion on the left of the multiplication C Q2(4) real quaternion on the right of the multiplication C OUTPUTS: C Q(4) real final quaternion C MODIFICATION HISTORY: C 2003 March, Aaron (UCSD/CASS) C- subroutine qmultiply(q1,q2,q) real*8 q1(4), q2(4), q(4) q(1) = q1(1)*q2(1) - q1(2)*q2(2) - q1(3)*q2(3) - q1(4)*q2(4) q(2) = q1(2)*q2(1) + q1(1)*q2(2) - q1(4)*q2(3) + q1(3)*q2(4) q(3) = q1(3)*q2(1) + q1(4)*q2(2) + q1(1)*q2(3) - q1(2)*q2(4) q(4) = q1(4)*q2(1) - q1(3)*q2(2) + q1(2)*q2(3) + q1(1)*q2(4) return end