def quaternion_inverse(quaternion):
 q = numpy.array(quaternion, dtype=numpy.float64, copy=True)
 numpy.negative(q[1:], q[1:])
 return (q / numpy.dot(q, q))

def quaternion_inverse ( quaternion ) : q = numpy . array ( quaternion , dtype = numpy . float64 , copy = True ) numpy . negative ( q [ 1 : ] , q [ 1 : ] ) return ( q / numpy . dot ( q , q ) )
return inverse of quaternion .