[Math] 2D analog to Unit Quaternions for Rotation

quaternionsrotations

I have been working with 3D rotations for some time now, wth my preferred implementation being realised using unit quaternions – especially from a computational efficiency point of view by avoiding any trigonomtric operations (the target is typically a resource-constrained microcontroller, sometimes without an FPU).

I now have a problem where I need to operate only in 2D space, rotating by a single angle (or, more correctly, successive single rotations, and using the ersult to rotate vectors). Of course, I have the option of ordinary complex numbers, or a reduced quaternion set, keeping two of the complex terms at zero.

I'm guessing this isn't the first time someone has needed to tackle this problem. So my questions are:

  • What would be the analog to unit quaternions in 2D space? Does it have a name, and does it have similar properies to unit quaternions in 3D space? Is this simply a a "reduced set" of unit quaternions being a complex number with the angle encoded as $z = \cos(\theta/2) + j \sin(\theta/2)$?
  • What are the advantages and disadvantages – especially from a numerical error and computational efficincy point of view – of using this represenation vs a standard complex number represenation, i.e. $z = \cos(\theta) + j \sin(\theta)$?
  • Or, am I better off with a different rotation represenation altogether, given the goals stated above?

Bonus question: I'm guessing this is part of a more general field of mathematics. What should I be looking at to find out more?

Best Answer

Quaternions with the restriction that you can only use a single rotation plane work just fine still. They would take the form

$$q = \cos \frac{\theta}{2} + v \sin \frac{\theta}{2}$$

for some unit quaternion $v$.

When we restrict ourselves to a single rotation plane, that means we consider rotating vectors (pure imaginary quaternions) that are perpendicular to the rotation axis (described by $v$).

It is not difficult to show that, for any vector $a \perp v$,

$$\exp(v \theta/2) a \exp(-v \theta/2) = \exp(v\theta) a = a \exp(-v \theta)$$

This is why complex rotations don't usually use the double-sided form that rotations in 3d use: it's simply unnecessary.

From a programming standpoint, the double-sided form requires more floating point operations; this is strictly unnecessary in 2d.

Of course, only the double-sided form of rotation generalizes beyond 3d.

With all this in mind, I think you can consider using quaternions with some terms zeroed out, but notice that when translating quaternions to 2d, the rotation axis is perpendicular to the vectors being rotated. This means you can't zero out particular components regardless of whether they're vectors being rotated or quaternions being used to rotate them.

Furthermore, I think the matter of ensuring some terms remain identically zero could be an issue. You might be better off converting to complex and then converting back when you're done.

Related Question