Post · 1 min read· p. 118

Quaternion.inverse

Quaternion.inverse : Return the inverse Quaternion

code
The inverse quaternion q−1\mathbf{q}^{-1} is such that the
quaternion times its inverse gives the identity quaternion
qI=(1000)\mathbf{q}_I=\begin{pmatrix}1 & 0 & 0 & 0\end{pmatrix}

It is obtained as:

q−1=q∗∥q∥2\mathbf{q}^{-1} = \frac{\mathbf{q}^*}{\|\mathbf{q}\|^2}
If the quaternion is normalized (called *versor*) its inverse is the conjugate.
q−1=q∗\mathbf{q}^{-1} = \mathbf{q}^*
Returns: : **out** – Inverse of quaternion. Return type: : numpy.ndarray Examples ```default

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

q.inverse array([ 0.18257419, 0.36514837, -0.54772256, 0.73029674])

q@q.inverse array([1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 2.77555756e-17]) ```