Post · 1 min read· p. 121

Quaternion.is_real

Quaternion.is_real() → bool : Returns a bool value, where True if quaternion is real.

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

{True qv=[000]False otherwise\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** – Boolean equal to True if qv=0q_v = 0. Return type: : bool Examples ```default

q = Quaternion() q Quaternion([1., 0., 0., 0.])

q.is_real() True

q = Quaternion([0., 1., 2., 3.]) q Quaternion([0. , 0.26726124, 0.53452248, 0.80178373])

q.is_real() False

q = Quaternion([1., 2., 3., 4.]) q Quaternion([0.18257419, 0.36514837, 0.54772256, 0.73029674])

q.is_real() False

q = Quaternion([5., 0., 0., 0.]) # All quaternions are normalized, by default q Quaternion([1., 0., 0., 0.])

q.is_real() True ```