# Can I use quaternions and do a partial multiplication?

I have some code that rotates an object around an axis. It does this by creating a quaternion for a rotation and then multiplying by the old orientation:

nextRot = QuaternionRotationAxis( axis, rotSpeed * elapsed )
newOrient = QuaternionMul( oldOrient, nextRot )


This need to create the rotation quaternion each time seems like it may be redundant. Is it possible to somehow create a quaternion and somehow apply elapsed to it? That is I would prefer code like this:

nextRot = SomeOp( fullRotationQuat, elapsed )


In this way I can store fullRotationQuat in my object and simply apply it partially on each time step.

I know that if I apply nextRot twice, it would be like doulbing the ellapsed time. So I'm guessing I might want some kind of quaternion exponentation. Is this a define op? More importantly, is its performance still acceptable (or faster) than creating from an axis/angle each time?

• What you are trying to do is called quaternion interpolation. Have a look at this May 19, 2014 at 19:58

If your elapsed factor is constant as well, then you may consider storing the incremental rotation as a quaternion and multiply the old quaternion by this new one each frame (should be faster than evaluating sincos).
As to your "bonus" question on whether it makes sense to think of an exponential operator on the quaternion space, your hunch is right. The only problem I see with this operator is that it's not going to help you in this particular case since it resolves to actually extracting the rotation axis from the quaternion and then building it back again. For more details, consult this short article http://web.mit.edu/2.998/www/QuaternionReport1.pdf . It is here where the properties of the log and exp are explained for quaternions. But their applications usually involve quaternion calculus or storing compressed animation tracks in more complex game engines.