;+
; Contains the q_conj function
;
; :Author:
; Baptiste Cecconi
;
; :History:
; 2005/01/13: Created
;
; 2005/01/13: Last Edit
;-
;
;+
; q_conj is a function that <behavior desc here>
;
; :Returns:
; <return desc here>
;
; :Params:
; q1in: in, required, type=sometype
; A parameter named q1in
;-
FUNCTION Q_conj,q1in
s1 = size(q1in)
n1 = (s1(0) eq 1) + (s1(0) eq 2)*s1(2)
if s1(1) ne 4 or n1 eq 0 then begin
print,"Q_CONJ : error, wrong argument size..."
print," Use : Q_CONJ,q1in"
print," > q1in must be a quaternion (4) or a vector of quaternions (4,n)"
return,-1
endif
q1 = reform(double(q1in),4,n1)
q2 = -q1
q2(0,*) = q1(0,*)
return,reform(q2)
end