Post · 2 min read· pp. 111–112

Quaternion.exponential

Quaternion.exponential : Exponential of Quaternion

code
The quaternion exponential is defined with the absolute convergent
power series:

eq=∑k=0∞qkk!e^{\mathbf{q}} = \sum_{k=0}^{\infty}\frac{\mathbf{q}^k}{k!}
We start with the exponential of a **pure quaternion** q=(0,qv)=0+xi+yj+zk\mathbf{q} = (0, \mathbf{q}_v) = 0 + xi + yj + zk:
\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 qv=uθ\mathbf{q}_v = \mathbf{u}\theta with θ=∥v∥\theta=\|\mathbf{v}\| and ∥u∥=1\|\mathbf{u}\|=1 we can express the exponential as:
eqv=euθ=(1−θ22!+θ44!+⋯)+(uθ−uθ33!+uθ55!+⋯)=cos⁡θ+usin⁡θ=[cos⁡θusin⁡θ]\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}
Since ∥eqv∥2=cos⁡2θ+sin⁡2θ=1\|e^{\mathbf{q}_v}\|^2=\cos^2\theta+\sin^2\theta=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θ=qv\mathbf{u}\theta=\mathbf{q}_v and the exponential of the pure quaternion:
eq=eqw+qv=eqweqv=eqw[cos⁡∥qv∥q∥qv∥sin⁡∥qv∥]\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}
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] ```