is_versor#
- ahrs.common.quaternion.QuaternionArray.is_versor(self) ndarray#
Returns an array of boolean values, where a value is
Trueif its corresponding quaternion has a norm equal to one.A versor is a quaternion, whose euclidean norm is equal to one: \(\|\mathbf{q}\| = \sqrt{w^2+x^2+y^2+z^2} = 1\)
\[\begin{split}\left\{ \begin{array}{ll} \mathrm{True} & \: \sqrt{w^2+x^2+y^2+z^2} = 1 \\ \mathrm{False} & \: \mathrm{otherwise} \end{array} \right.\end{split}\]- Returns:
out – Array of booleans.
- Return type:
np.ndarray
Example
>>> Q = QuaternionArray(np.random.random((3, 4))-0.5) >>> Q[1] = [1.0, 2.0, 3.0, 4.0] >>> Q.view() QuaternionArray([[-0.8061095 , 0.42513151, 0.37790158, -0.16322091], [ 1. , 2. , 3. , 4. ], [ 0.29613776, 0.21692562, -0.16253866, -0.91587493]]) >>> Q.is_versor() array([ True, False, True])