O'Reilly logo

3D Programming for Windows® by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Quaternions and Rotation

So far, quaternions have been fairly abstract, except that a pure quaternion is a vector, so it's just as useful as vectors are. Now let's define a quaternion that represents a rotation in three-dimensional space.

Again, it's helpful to look at complex numbers to get a general pattern, and then apply that pattern to quaternions. The following complex number represents a rotation in two-dimensional space:

Quaternions and Rotation

Multiply this complex number by any point (also represented by a complex number) and the point is rotated around the origin by θrotation degrees. This complex number we've called crotate is normalized because for any angle ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required