is_real#

ahrs.common.quaternion.QuaternionArray.is_real(self) ndarray#

Returns an array of boolean values, where a value is True if its corresponding quaternion is real.

A real quaternion has all elements of its vector part equal to zero: \(\mathbf{q} = w + 0i + 0j + 0k = \begin{pmatrix} q_w & \mathbf{0}\end{pmatrix}\)

\[\begin{split}\left\{ \begin{array}{ll} \mathrm{True} & \: \mathbf{q}_v = \begin{bmatrix} 0 & 0 & 0 \end{bmatrix} \\ \mathrm{False} & \: \mathrm{otherwise} \end{array} \right.\end{split}\]
Returns:

out – Array of booleans.

Return type:

np.ndarray

Example

>>> Q = QuaternionArray([[1., 0., 0., 0.], [1., 2., 3., 4.], [-1., 0., 0., 0.]])
>>> Q.is_real()
array([True, False, True])