;docformat = 'rst' ;+ ;This routine multiplies the two input quaternions. ; ; :Author: ; Brian Boyle: 11-14-1996, ; Ryan Talley: 06-08-2015 (added rst formatting) ; ; :Examples: ; product = quat_mult(quaternion_q1, quaternion_q2) ;- ;+ ; :Params: ; q1 : in, required, type=vector of int or vector of double ; Input quaternion of form, x-dimension value, y-dimension value, ; z-dimension value, scalar value. ; q2 : in, required, type=vector of int or vector of double ; Input quaternion of form, x-dimension value, y-dimension value, ; z-dimension value, scalar value. ; ; :Returns: ; Returns a quaternion resulting from the multiplication of the two ; input quaternions. ;- function quat_mult,q1,q2 if n_params() ne 2 then begin message,/info,'USAGE: result = quat_mult(q1,q2)' return,-1 endif ; ; Multiply Quaternions ; q = [[q1(3),-q1(2),q1(1),-q1(0)],[q1(2),q1(3),-q1(0),-q1(1)],$ [-q1(1),q1(0),q1(3),-q1(2)],[q1(0),q1(1),q1(2),q1(3)]]#q2 ; ; Done ; return,q end