is_identity¶
-
Quaternion.
is_identity
() → bool¶ Returns a bool value, where
True
if quaternion is identity quaternion.An identity quaternion has its scalar part equal to 1, and its vector part equal to 0, such that \(\mathbf{q} = 1 + 0i + 0j + 0k\).
\[\begin{split}\left\{ \begin{array}{ll} \mathrm{True} & \: \mathbf{q}\ = \begin{pmatrix} 1 & 0 & 0 & 0 \end{pmatrix} \\ \mathrm{False} & \: \mathrm{otherwise} \end{array} \right.\end{split}\]Returns: out – Boolean equal to True
if \(\mathbf{q}=\begin{pmatrix}1 & 0 & 0 & 0\end{pmatrix}\).Return type: bool Examples
>>> q = Quaternion() >>> q Quaternion([1., 0., 0., 0.]) >>> q.is_identity() True >>> q = Quaternion([0., 1., 0., 0.]) >>> q Quaternion([0., 1., 0., 0.]) >>> q.is_identity() False