spacepy.coordinates.quaternionNormalize

spacepy.coordinates.quaternionNormalize(Qin, scalarPos='last')[source]

Given an input quaternion (or array of quaternions), return the unit quaternion

Parameters
vecarray_like

input quaternion to normalize

Returns
outarray_like

normalized quaternion

Examples

>>> import spacepy.coordinates
>>> spacepy.coordinates.quaternionNormalize([0.707, 0, 0.707, 0.2])
array([ 0.69337122,  0.        ,  0.69337122,  0.19614462])