Rotation matrix

chemistry may interpret these as

while aircraft dynamics may use

One systematic approach begins with choosing the right-most axis. Among all permutations of (x,y,z), only two place that axis first; one is an even permutation and the other odd. Choosing parity thus establishes the middle axis. That leaves two choices for the left-most axis, either duplicating the first or not. These three choices gives us 322 = 12 variations; we double that to 24 by choosing static or rotating axes.

This is enough to construct a matrix from angles, but triples differing in many ways can give the same rotation matrix. For example, suppose we use the zyz convention above; then we have the following equivalent pairs:

(90,

45,

105)

(270,

315,

255)

multiples of 360

(72,

0,

0)

(40,

0,

32)

singular alignment

(45,

60,

30)

(135,

60,

150)

bistable flip

Angles for any order can be found using a concise common routine (Herter & Lott 1993; Shoemake 1994).

The problem of singular alignment, the mathematical analog of physical gimbal lock, occurs when the middle rotation aligns the axes of the first and last rotations. It afflicts every axis order at either even or odd multiples of 90. These singularities are not characteristic of the rotation matrix as such, and only occur with the usage of Euler angles.

The singularities are avoided when considering and manipulating the rotation matrix as orthonormal row vectors (in 3D applications often named ‘right’-vector, ‘up’-vector and ‘out’-vector) instead of as angles. The singularities are also avoided when working with quaternions.

Uniform random rotation matrices

We sometimes need to generate a uniformly distributed random rotation matrix. It seems intuitively clear in two dimensions that this means the rotation angle is uniformly distributed between 0 and 2. That intuition is correct, but does not carry over to higher dimensions. For example, if we decompose 33 rotation matrices in axis-angle form, the angle should not be uniformly distributed; the probability that (the magnitude of) the angle is at most should be 1(  sin ), for 0    .

Since SO(n) is a connected and locally compact Lie group, we have a simple standard criterion for uniformity, namely that the distribution be unchanged when composed with any arbitrary rotation (a Lie group “translation”). This definition corresponds to what is called Haar measure. Len, Mass & Rivest (2006) show how to use the Cayley transform to generate and test matrices according to this criterion.

We can also generate a uniform distribution in any dimension using the subgroup algorithm of Diaconis & Shashahani (1987). This recursively exploits the nested dimensions group structure of SO(n), as follows. Generate a uniform angle and construct a 22 rotation matrix. To step from n to n+1, generate a vector v uniformly distributed on the n-sphere, Sn, embed the nn matrix in the next larger size with last column (0,,0,1), and rotate the larger matrix so the last column becomes v.

As usual, we have special alternatives for the 33 case. Each of these methods begins with three independent random scalars uniformly distributed on the unit interval. Arvo (1992) takes advantage of the odd dimension to change a Householder reflection to a rotation by negation, and uses that to aim the axis of a uniform planar rotation.

Another method uses unit quaternions. Multiplication of rotation matrices is homomorphic to multiplication of quaternions, and multiplication by a unit quaternion rotates the unit sphere. Since the homomorphism is a local isometry, we immediately conclude that to produce a uniform distribution on SO(3) we may use a uniform distribution on S3.

Euler angles can also be used, though not with each angle uniformly distributed (Murnaghan 1962; Miles 1965).

For the axis-angle form, the axis is uniformly distributed over the unit sphere of directions, S2, while the angle has the non-uniform distribution over [0,] noted previously (Miles 1965).

See also

Rotation representation

Isometry

Orthogonal matrix

Rodrigues’ rotation formula

Yaw-pitch-roll system

Plane of rotation

Notes

^ W3C recommendation (2003). “Scalable Vector Graphics — the initial coordinate system”. http://www.w3.org/TR/SVG/coords.html#InitialCoordinateSystem. 

^ Murray, Glenn (2005). “Rotation About an Arbitrary Axis in 3 Dimensions”. http://inside.mines.edu/~gmurray/ArbitraryAxisRotation/ArbitraryAxisRotation.html. 

References

Arvo, James (1992), “Fast random rotation matrices”, in David Kirk, Graphics Gems III, San Diego: Academic Press Professional, pp. 117120, ISBN 978-0-12-409671-4, http://www.graphicsgems.org/ 

Baker, Andrew (2003), Matrix Groups: An Introduction to Lie Group

Pages: 1 2 3 4 5 6 7 8 9 10