is_pure#
- ahrs.common.quaternion.QuaternionArray.is_pure(self) ndarray#
Returns an array of boolean values, where a value is
Trueif its corresponding quaternion is pure.A pure quaternion has a scalar part equal to zero: \(\mathbf{q} = 0 + xi + yj + zk\)
\[\begin{split}\left\{ \begin{array}{ll} \mathrm{True} & \: w = 0 \\ \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, 0] = 0.0 >>> Q.view() QuaternionArray([[ 0.32014817, 0.47060011, 0.78255824, 0.25227621], [ 0. , -0.79009137, 0.47021242, -0.26103598], [-0.65182559, -0.3032904 , 0.16078433, -0.67622979]]) >>> Q.is_pure() array([False, True, False])