Quaternion

From DmWiki

Quaternions are an alternative method of handling rotations, besides rotation matrices.

The primary advantages of quaternions over other representations is that they are particularly well-suited to interpolation between two rotations. They do not suffer from gimbal lock (http://www.anticz.com/eularqua.htm).

Definition

The set of quaternions is the set of vectors in R4, the 4-dimensional Eucledian space. This set has the structure of a non-commutative ring with addition defined as vector addition and with a multiplication similar to complex multiplication. In fact, the complex numbers embed as a sub ring of the quaternions.

Connection with rotation matrices

The set of ortonormal ordered bases for an n-dimensional vector space is canonically identified with the set of nxn matrices having determinant 1 or -1. This set has a group structure by multiplying matrices toghether, and this group is commonly denoted by O(n); the orthogonal group of nxn matrices. As a topological space it has the topology as a subspace of the space of all n\times n matrices. Moreover, it consists of two components: The component containting the identity matrix consisting of all orthogonal matrices of determinant 1 and a homeomorphic component containg all the orthofonal matrices of determinant -1. The prior is called the special orthogonal group and is denoted SO(n).

In computer graphics, rotations of various objects are commonly accomplished by chosing some continuous timedependent path of matrices in SO(3) and applying them to the objects one wants to rotate.

The simplest examples of such paths are constructed by chosing simple paths of matrices and multiplying them toghether.

In pratice one often wants to interpolate between two given matrices inside SO(3). This requires much work, because of the geometry of SO(3): By definition, it is a sub space of all nxn matrices. The latter space is isomorphic to the 9 dimensional Eucledian space, by thinking of the (i,j)th entry in a matrix as the (i + 3 * (j - 1))th entry of R9. Hence, given two matrices in SO(3), the first inclanation would be to linearly interpolate between these matrices in the surrounding Eucledian space. Of course, this interpolation will generally bring the interpolated matrices out of SO(3). One could then try to rectify the situation by forcing the interpolated matrices to be orthogonal, but at this point quaternions come in handy.

The connection between quaternions and SO(3) is the following: Consider the subset of quaternions having length 1 as vectors in Eucledian 4-space. Then, analogously to the complex case, this set is closed under multiplication and has so the structure of a group. As a space it is homeomorphic to the 3-dimensional sphere.

One might then form the quotient space by declaring that a unit quaternion x should be equal to its antipode - x. The resulting space is then canconically homeomorphic to the special orthogonal group.

Thus, to interpolate between two given matrices of determinant 1, one can then chose two corresponding unit quaternions and try to interpolate between them instead. This task is much easier, since the geometry of the 3-sphere is much simpler than the geometry of the special orthogonal group: The only requirement one has to impose on the interpolation is that that every point on the interpolated path has length one as a vector in 4 dimenional Eucledian space.

This article is a stub. You can help improve the article by expanding it.

DevMaster navigation