quat_bound¶
Given a quaternion, \(\vec{\chi}\), associated to a rotation of angle \(\psi\) about an axis \(\mathbf{\hat{n}}\), the function “bounds” the quaternion, i.e. sets the rotation axis \(\mathbf{\hat{n}}\) such that \(\psi\) in \([-\pi,\pi]\).
Notes
As quaternions are defined as:
\[\vec{\chi}= \left[\cos\left(\frac{\psi}{2}\right),\, \sin\left(\frac{\psi}{2}\right)\mathbf{\hat{n}}\right]\]
this is equivalent to enforcing \(\chi_0\ge0\).
param quat: | quaternion to bound |
---|---|
type quat: | np.array |
returns: | bounded quaternion |
rtype: | np.array |