Post · 2 min read· pp. 111–112
Quaternion.exponential Quaternion.exponential
: Exponential of Quaternion
code Copy
The quaternion exponential is defined with the absolute convergent
power series:
e q = ∑ k = 0 ∞ q k k ! e^{\mathbf{q}} = \sum_{k=0}^{\infty}\frac{\mathbf{q}^k}{k!} e q = k = 0 ∑ ∞ k ! q k
We start with the exponential of a **pure quaternion**
q = ( 0 , q v ) = 0 + x i + y j + z k \mathbf{q} = (0, \mathbf{q}_v) = 0 + xi + yj + zk q = ( 0 , q v ) = 0 + x i + y j + z k :
\begin{split}e^{\mathbf{q}_v} &=& \sum_{k=0}^{\infty}\frac{\mathbf{q}_v^k}{k!} \\\end{split}
With the help of [Euler’s formula](https://en.wikipedia.org/wiki/Euler%27s_formula#Using_power_series),
and letting q v = u θ \mathbf{q}_v = \mathbf{u}\theta q v = u θ with
θ = ∥ v ∥ \theta=\|\mathbf{v}\| θ = ∥ v ∥ and ∥ u ∥ = 1 \|\mathbf{u}\|=1 ∥ u ∥ = 1 we
can express the exponential as:
e q v = e u θ = ( 1 − θ 2 2 ! + θ 4 4 ! + ⋯ ) + ( u θ − u θ 3 3 ! + u θ 5 5 ! + ⋯ ) = cos θ + u sin θ = [ cos θ u sin θ ] \begin{split}\begin{array}{rcl}
e^{\mathbf{q}_v} &=& e^{\mathbf{u}\theta} \\
&=&
\Big(1-\frac{\theta^2}{2!} + \frac{\theta^4}{4!}+\cdots\Big)+
\Big(\mathbf{u}\theta-\frac{\mathbf{u}\theta^3}{3!} + \frac{\mathbf{u}\theta^5}{5!}+\cdots\Big) \\
&=& \cos\theta + \mathbf{u}\sin\theta \\
&=& \begin{bmatrix}\cos\theta \\ \mathbf{u}\sin\theta \end{bmatrix}
\end{array}\end{split} e q v = = = = e u θ ( 1 − 2 ! θ 2 + 4 ! θ 4 + ⋯ ) + ( u θ − 3 ! u θ 3 + 5 ! u θ 5 + ⋯ ) cos θ + u sin θ [ cos θ u sin θ ]
Since ∥ e q v ∥ 2 = cos 2 θ + sin 2 θ = 1 \|e^{\mathbf{q}_v}\|^2=\cos^2\theta+\sin^2\theta=1 ∥ e q v ∥ 2 = cos 2 θ + sin 2 θ = 1 ,
the exponential of a pure quaternion is always unitary. Therefore, if
the quaternion is real, its exponential is the identity.
For **general quaternions** the exponential is defined using
u θ = q v \mathbf{u}\theta=\mathbf{q}_v u θ = q v and the exponential of the
pure quaternion:
e q = e q w + q v = e q w e q v = e q w [ cos ∥ q v ∥ q ∥ q v ∥ sin ∥ q v ∥ ] \begin{split}\begin{array}{rcl}
e^{\mathbf{q}} &=& e^{q_w+\mathbf{q}_v} = e^{q_w}e^{\mathbf{q}_v}\\
&=& e^{q_w}
\begin{bmatrix}
\cos\|\mathbf{q}_v\| \\ \frac{\mathbf{q}}{\|\mathbf{q}_v\|}\sin\|\mathbf{q}_v\|
\end{bmatrix}
\end{array}\end{split} e q = = e q w + q v = e q w e q v e q w [ cos ∥ q v ∥ ∥ q v ∥ q sin ∥ q v ∥ ]
Returns:
: **exp** – Exponential of quaternion.
Return type:
: numpy.ndarray
Examples
```default
q1 = Quaternion([0.0, -2.0, 3.0, -4.0])
str(q1)
'(0.0000 -0.3714i +0.5571j -0.7428k)'
q1.exponential
[ 0.54030231 -0.31251448 0.46877172 -0.62502896]
q2 = Quaternion([1.0, -2.0, 3.0, -4.0])
str(q2)
'(0.1826 -0.3651i +0.5477j -0.7303k)'
q2.exponential
[ 0.66541052 -0.37101103 0.55651655 -0.74202206]
```
← Previous Quaternion.exp Next → Quaternion.from_DCM