I am not going to explain how quaternion can be used to ratate 3D vectors. Instead, the aim of this article is to summarize and share a few useful ideas about quaternions in some projects:

Let q be a quaternion. As we know, a quaternion has one real component and three imaginary component. The three imaginary units i, j and k fullfill i

q = { w, x, y, z } = { w, v } = w + x⋅i + y⋅j + z⋅k

To get our axis/angle notation we just have to impose to our quaternion that the real component w is the cosine of a given half-angle and the vector v to be a normalized vector a scaled by the sine of that same half-angle.

q = { cos(ω/2), a⋅ sin(ω/2) }

Such a quaternion following the last restriction can be checked to be normalized, since by the definition of norm/modulus of a quaternion

|q|

we have that

|q|

so

|v|

Now, the interesting property comes into the game. The exponentiation of quaternions happens to be like this

q

What results in the following interpretation: self-multiplying a quaternion

We can now start to see why quaternions are used for angular operations. Actually, we know a normalized quaternion represents a 3D rotation around the axis

We can now easily convert any angular operation that we want to perform into the correct quaternion operations. Just replace additions/subtractions by multiplications/divisions, and multiplications/divisions by powers/roots, and we are done.

This relationship between angle and quaternion operations quite resembles the relationship between linear and logarithmical operations (say, Laplace Transform)... Actually, there is a reason for this, and it is that quaternions are a generalization of complex numbers, and as such normalized quaternions are generalization of pure complex exponentials and thus the logarithmic relationships come apparent. Actually, if we have the following normalized quaternion

q

and we make the axis equal to the real axis a=(1,0,0), we have

q

which is your traditional complex number rotor.

Let q be a quaternion. As we know, a quaternion has one real component and three imaginary component. The three imaginary units i, j and k fullfill i

^{2}=-1, j^{2}=-1 and k^{2}=-1, as usual. However, what we are interested in for 3D graphics is in the axis/angle notation of the quaternion. By packing together the three imaginary components we can think on the quaternion as a real value w plus a 3D vector v = { x, y, z }:q = { w, x, y, z } = { w, v } = w + x⋅i + y⋅j + z⋅k

To get our axis/angle notation we just have to impose to our quaternion that the real component w is the cosine of a given half-angle and the vector v to be a normalized vector a scaled by the sine of that same half-angle.

q = { cos(ω/2), a⋅ sin(ω/2) }

Such a quaternion following the last restriction can be checked to be normalized, since by the definition of norm/modulus of a quaternion

|q|

^{2}= w^{2}+ x^{2}+ y^{2}+ z^{2}we have that

|q|

^{2}= cos^{2}(ω/2) + (x^{2}+ y^{2}+ z^{2})⋅sin^{2}(ω/2)so

|v|

^{2}= 1 → |q|^{2}= cos^{2}(ω/2) + sin^{2}(ω/2) = 1Now, the interesting property comes into the game. The exponentiation of quaternions happens to be like this

q

^{t}= { cos(ω/2), a⋅ sin(ω/2) }^{t}= { cos(ω⋅t/2), a⋅ sin(ω⋅t/2) }What results in the following interpretation: self-multiplying a quaternion

**times is the same as multiplying the angle by***t***(even if I find this interpretation a bit tricky for non integer values of***t***...).***t*We can now start to see why quaternions are used for angular operations. Actually, we know a normalized quaternion represents a 3D rotation around the axis

**by an angle of ω. And we know that concatenating two rotations can be done by multiplying the two corresponding quaternions. Hence what we have to remember is just the first two rows of the following table:***a*Angular Space | Quaternion Space | |

Add | α + β | q_{α} ⋅ q_{β} |

Scale | α ⋅ t | q_{α}^{t} |

Mad | α + β ⋅ t | q_{α} ⋅ q_{β}^{t} |

Lerp | α ⋅ t + β ⋅ (1-t) | q_{α}^{t} ⋅ q_{β}^{1-t} |

We can now easily convert any angular operation that we want to perform into the correct quaternion operations. Just replace additions/subtractions by multiplications/divisions, and multiplications/divisions by powers/roots, and we are done.

This relationship between angle and quaternion operations quite resembles the relationship between linear and logarithmical operations (say, Laplace Transform)... Actually, there is a reason for this, and it is that quaternions are a generalization of complex numbers, and as such normalized quaternions are generalization of pure complex exponentials and thus the logarithmic relationships come apparent. Actually, if we have the following normalized quaternion

q

_{ω,a}= cos(ω/2) + a⋅ sin(ω/2)and we make the axis equal to the real axis a=(1,0,0), we have

q

_{ω,(1,0,0)}= cos(ω/2) + i⋅ sin(ω/2) = e^{i⋅ ω/2}which is your traditional complex number rotor.