Neha Patil (Editor)

Three dimensional rotation operator

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

This article derives the main properties of rotations in 3-dimensional space.

Contents

The three Euler rotations are one way to bring a rigid body to any desired orientation by sequentially making rotations about axis' fixed relative to the object. However, this can also be achieved with one single rotation (Euler's rotation theorem). Using the concepts of linear algebra it is shown how this single rotation can be performed.

Mathematical formulation

Let

e ^ 1   ,   e ^ 2   ,   e ^ 3

be a coordinate system fixed in the body that through a change in orientation is brought to the new directions

A e ^ 1   ,   A e ^ 2   ,   A e ^ 3 .

Any vector

x ¯   = x 1 e ^ 1 + x 2 e ^ 2 + x 3 e ^ 3

rotating with the body is then brought to the new direction

A x ¯   = x 1 A e ^ 1 + x 2 A e ^ 2 + x 3 A e ^ 3

i.e. this is a linear operator

The matrix of this operator relative to the coordinate system

e ^ 1   ,   e ^ 2   ,   e ^ 3

is

[ A 11 A 12 A 13 A 21 A 22 A 23 A 31 A 32 A 33 ] = [ e ^ 1 | A e ^ 1 e ^ 1 | A e ^ 2 e ^ 1 | A e ^ 3 e ^ 2 | A e ^ 1 e ^ 2 | A e ^ 2 e ^ 2 | A e ^ 3 e ^ 3 | A e ^ 1 e ^ 3 | A e ^ 2 e ^ 3 | A e ^ 3 ]

As

k = 1 3 A k i A k j = A e ^ i | A e ^ j = { 0 i j , 1 i = j ,

or equivalently in matrix notation

[ A 11 A 12 A 13 A 21 A 22 A 23 A 31 A 32 A 33 ] T [ A 11 A 12 A 13 A 21 A 22 A 23 A 31 A 32 A 33 ] = [ 1 0 0 0 1 0 0 0 1 ]

the matrix is orthogonal and as a "right hand" base vector system is re-orientated into another "right hand" system the determinant of this matrix has the value 1.

Rotation around an axis

Let

e ^ 1   ,   e ^ 2   ,   e ^ 3

be an orthogonal positively oriented base vector system in R 3 .

The linear operator

"Rotation with the angle θ around the axis defined by e ^ 3 "

has the matrix representation

[ Y 1 Y 2 Y 3 ] = [ cos θ sin θ 0 sin θ cos θ 0 0 0 1 ] [ X 1 X 2 X 3 ]

relative to this basevector system.

This then means that a vector

x ¯ = [ e ^ 1 e ^ 2 e ^ 3 ] [ X 1 X 2 X 3 ]

is rotated to the vector

y ¯ = [ e ^ 1 e ^ 2 e ^ 3 ] [ Y 1 Y 2 Y 3 ]

by the linear operator.

The determinant of this matrix is

det [ cos θ sin θ 0 sin θ cos θ 0 0 0 1 ] = 1

and the characteristic polynomial is

det [ cos θ λ sin θ 0 sin θ cos θ λ 0 0 0 1 λ ] = ( ( cos θ λ ) 2 + sin θ 2 ) ( 1 λ ) = λ 3 + ( 2   cos θ   +   1 )   λ 2 ( 2   cos θ   +   1 )   λ + 1

The matrix is symmetric if and only if sin θ = 0 , i.e. for θ = 0 and for θ = π .

The case θ = 0 is the trivial case of an identity operator.

For the case θ = π the characteristic polynomial is

( λ 1 ) ( λ + 1 ) 2

i.e. the rotation operator has the eigenvalues

λ = 1 λ = 1

The eigenspace corresponding to λ = 1 is all vectors on the rotation axis, i.e. all vectors

x ¯ = α   e ^ 3 < α <

The eigenspace corresponding to λ = 1 consists of all vectors orthogonal to the rotation axis, i.e. all vectors

x ¯ = α   e ^ 1 + β   e ^ 2 < α < < β <

For all other values of θ the matrix is un-symmetric and as sin θ 2 > 0 there is only the eigenvalue λ = 1 with the one-dimensional eigenspace of the vectors on the rotation axis:

x ¯ = α   e ^ 3 < α <

The rotation matrix by angle θ around a general axis of rotation k = [ k 1 k 2 k 3 ] is given by Rodrigues' rotation formula.

R = I cos θ + [ k ] × sin θ + ( 1 cos θ ) k k T ,

where I is the identity matrix and [ k ] × is the dual 2-form of k or cross product matrix,

[ k ] × = [ 0 k 3 k 2 k 3 0 k 1 k 2 k 1 0 ] .

Note that [ k ] × satisfies [ k ] × v = k × v for all v .

The general case

The operator

"Rotation with the angle θ around a specified axis"

discussed above is an orthogonal mapping and its matrix relative to any base vector system is therefore an orthogonal matrix . Furthermore its determinant has the value 1. A non-trivial fact is the opposite, i.e. that for any orthogonal linear mapping in R 3 having determinant = 1 there exist base vectors

e ^ 1   ,   e ^ 2   ,   e ^ 3

such that the matrix takes the "canonical form"

[ cos θ sin θ 0 sin θ cos θ 0 0 0 1 ]

for some value of θ .

In fact, if a linear operator has the orthogonal matrix

[ A 11 A 12 A 13 A 21 A 22 A 23 A 31 A 32 A 33 ]

relative some base vector system

f ^ 1   ,   f ^ 2   ,   f ^ 3

and this matrix is symmetric, the "Symmetric operator theorem" valid in R n (any dimension) applies saying

that it has n orthogonal eigenvectors. This means for the 3-dimensional case that there exists a coordinate system

e ^ 1   ,   e ^ 2   ,   e ^ 3

such that the matrix takes the form

[ B 11 0 0 0 B 22 0 0 0 B 33 ]

As it is an orthogonal matrix these diagonal elements B i i are either 1 or −1. As the determinant is 1 these elements are either all 1 or one of the elements is 1 and the other two are −1.

In the first case it is the trivial identity operator corresponding to θ = 0 .

In the second case it has the form

[ 1 0 0 0 1 0 0 0 1 ]

if the basevectors are numbered such that the one with eigenvalue 1 has index 3. This matrix is then of the desired form for θ = π .

If the matrix is un-symmetric, the vector

E ¯ = α 1   f ^ 1 + α 2   f ^ 2 + α 3   f ^ 3

where

α 1 = A 32 A 23 2 α 2 = A 13 A 31 2 α 3 = A 21 A 12 2

is non-zero. This vector is an eigenvector with eigenvalue

λ = 1

Setting

e ^ 3 = E ¯ | E ¯ |

and selecting any two orthogonal unit vectors in the plane orthogonal to e ^ 3 :

e ^ 1   ,   e ^ 2

such that

e ^ 1   ,   e ^ 2 ,   e ^ 3

form a positively oriented triple, the operator takes the desired form with

cos θ = A 11 + A 22 + A 33 1 2 sin θ = | E ¯ |

The expressions above are in fact valid also for the case of a symmetric rotation operator corresponding to a rotation with θ = 0 or θ = π . But the difference is that for θ = π the vector

E ¯ = α 1   f ^ 1 + α 2   f ^ 2 + α 3   f ^ 3

is zero and of no use for finding the eigenspace of eigenvalue 1, i.e. the rotation axis.

Defining E 4 as cos θ the matrix for the rotation operator is

1 E 4 E 1 2 + E 2 2 + E 3 2 [ E 1 E 1 E 1 E 2 E 1 E 3 E 2 E 1 E 2 E 2 E 2 E 3 E 3 E 1 E 3 E 2 E 3 E 3 ] + [ E 4 E 3 E 2 E 3 E 4 E 1 E 2 E 1 E 4 ]

provided that

E 1 2 + E 2 2 + E 3 2 > 0

i.e. except for the cases θ = 0 (the identity operator) and θ = π

Quaternions

Quaternions are defined similar to E 1   ,   E 2   ,   E 3   ,   E 4 with the difference that the half angle θ 2 is used instead of the full angle θ .

This means that the first 3 components q 1   ,   q 2   ,   q 3   are components of a vector defined from

q 1   f 1 ^   +   q 2   f 2 ^   +     q 3   f 1 ^   =   sin θ 2 e 3 ^ = sin θ 2 sin θ E ¯

and that the fourth component is the scalar

q 4 = cos θ 2

As the angle θ defined from the canonical form is in the interval

0 θ π

one would normally have that q 4 0 . But a "dual" representation of a rotation with quaternions is used, i.e.

q 1   ,   q 2   ,   q 3   ,   q 4  

and

q 1   ,   q 2   ,   q 3   ,   q 4  

are two alternative representations of one and the same rotation.

The entities E k are defined from the quaternions by

E 1 = 2 q 4 q 1 E 2 = 2 q 4 q 2 E 3 = 2 q 4 q 3 E 4 = q 4 2 ( q 1 2 + q 2 2 + q 3 2 )

Using quaternions the matrix of the rotation operator is

[ 2 ( q 1 2 + q 4 2 ) 1 2 ( q 1 q 2 q 3 q 4 ) 2 ( q 1 q 3 + q 2 q 4 ) 2 ( q 1 q 2 + q 3 q 4 ) 2 ( q 2 2 + q 4 2 ) 1 2 ( q 2 q 3 q 1 q 4 ) 2 ( q 1 q 3 q 2 q 4 ) 2 ( q 2 q 3 + q 1 q 4 ) 2 ( q 3 2 + q 4 2 ) 1 ]

Numerical example

Consider the reorientation corresponding to the Euler angles α = 10 β = 20 γ = 30 relative a given base vector system

f ^ 1   ,   f ^ 2 ,   f ^ 3

Corresponding matrix relative to this base vector system is (see Euler angles#Matrix orientation)

[ 0.771281 0.633718 0.059391 0.613092 0.714610 0.336824 0.171010 0.296198 0.939693 ]

and the quaternion is

( 0.171010 ,   0.030154 ,   0.336824 ,   0.925417 )

The canonical form of this operator

[ cos θ sin θ 0 sin θ cos θ 0 0 0 1 ]

with θ = 44.537 is obtained with

e ^ 3 = ( 0.451272 , 0.079571 , 0.888832 )

The quaternion relative to this new system is then

( 0 ,   0 ,   0.378951 ,   0.925417 ) = ( 0 ,   0 ,   sin θ 2 ,   cos θ 2 )

Instead of making the three Euler rotations

10 , 20 , 30

the same orientation can be reached with one single rotation of size 44.537 around e ^ 3

References

Three-dimensional rotation operator Wikipedia


Similar Topics