**and**

*lerp()***functions for quaternions, widely used for key-frame interpolation, and never mind about the origin of the functions; and actually it's normally not a problem because armed with these two, plus a**

*slerp()***and**

*quat2matrix()***functions we are done. Or may be not? What happens when we have a physics engine and we want to "increment" and angular transformation of an object by an incremental rotation (coming from an Euler/Verlet integration)? Or when we just want to blend more than two quaternions and we cannot use the**

*euler2quat()***? Ok, that what we will solve in this small article. Let's go into business.**

*lerp()*Let

**be a quaternion. As we know, a quaternion has one real component and three imaginary component. The three imaginary units**

*q***,**

*i***and**

*j***are equal to the square root of minus one, 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**

*k***plus a 3D vector**

*w***. To get our axis/angle notation we just have to impose to our quaternion that the real component**

*v***is the cosine of a given (half-)angle and the vector**

*w***to be a normalized vector scaled by the sine of that same (half-)angle.**

*v*Now, the interesting property comes into the game. The power of a quaternions happens to be like this

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***...). 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**

*t***by an angle of**

*a***. 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:**

*alpha*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 (ala 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

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