Sei sulla pagina 1di 11

The 3 3 rotation matrix The cross product and its associated matrix

p. 1

The cross product a b is only dened for vectors in IR3.


a1 b1 a2 b3 a3 b2 a , b = b , then a b = a b a b If a = 2 1 3 2 3 1 a3 b3 a1b2 a2b1

The cross product has the following properties: aT (a b) = 0 and bT (a b) = 0. The cross product is therefore a vector that is perpendicular to both a and b. ||a b|| = ||a|| ||b|| sin , where is the angle between a and b. From this it follows that a a = 0. The cross product can however also be associated with matrix multiplication: a b = A b, where 0 a3 a2 a A= 3 0 a1 a2 a1 0

a b = b a.

The 3 3 rotation matrix

p. 2

The cross product matrix A has the following properties: It is anti-symmetrical: AT = A. A2 is symmetrical. It does not have an inverse: det(A) = 0.

A3 = ||a||2 A, and if ||a|| = 1, then A3 = A. Tr(A2) = 2||a||2.

Equality of matrices Generally Ax = Bx does not imply that A = B, but when enough independent vectors x can be found, equality can be proved: Theorem: Let A and B be n n matrices. When n linearly independent vectors xk , k = 1, 2, . . . , n can be found so that Axk = Bxk , then A = B. Proof: or AX = BX, where X = [x1, x2, . . . , xn], but the columns of X are linearly independent, therefore X 1 exists and AXX 1 = BXX 1, therefore A = B. ./ A[x1, x2, . . . , xn] = B[x1, x2, . . . , xn]

The 3 3 rotation matrix Derivation of the 3 3 rotation matrix

p. 3

We now want to solve the following problem: Given a certain normalized vector a, and an angle , nd the 3 3 rotation matrix that will rotate all vectors in IR3 about a through the angle . Consider three orthogonal normalized vectors in IR3, a, b and c, and let them be constructed in such a way that c = a b = A b.

We want to nd the rotation matrix Q, that rotates b and c through an angle of , but leaves a unchanged.
a

Qc

Qb

Qb

Qc

Then Qa = a Qb = b cos + c sin Qc = c cos b sin (1) (2) (3)

The 3 3 rotation matrix Substitute c = A b into (2) and (3): Qb = (I cos + A sin )b QAb = (I sin + A cos )b Now dierentiate (4) w.r.t. : Q b = [I sin + A cos ]b and from (5) follows that Q b = QAb

p. 4

(4) (5)

(6)

(7)

Note that a c = b (right hand rule for cross product). This implies that Ac = b and b = Ac. Now dierentiate (3) w.r.t. : Q c = = = = c sin b cos

Qb Q[Ac] QAc

(8)

The 3 3 rotation matrix Also dierentiate (1) w.r.t. : Q a=0 and QAa = 0 (since Aa = 0), and therefore Q a = QAa

p. 5

(9)

Since a, b and c are linearly independent vectors, it follows from (7), (8), (9), and the theorem in the previous paragraph, that Q = QA (10)

This is a matrix dierential equation with initial condition Q(0) = I The solution is Q = eA By expanding eA into a Taylor series, verify on your own that the above is the solution of (10).

The 3 3 rotation matrix Other formulas for the rotation matrix

p. 6

The rotation matrix Q can also be written in terms of sin and cos : Q = I + A + 1 2 2 1 3 3 A + A + ... 2! 3!

but A3 = A, A4 = A2, A5 = A, etc., therefore


Q = I + A + 1 2 2 1 3 1 A A 4A2 + . . . 2! 3! 4! 3 5 2 4 2 = I + A ( + . . .) + A (1 + + . . .) + A2 3! 5! 2! 4!

and then Q = I + A sin + A2(1 cos ) For a given a and , Q can be obtained from the above formula. For a given Q, a and can be found as follows: Tr(Q) = Tr(I) + sin Tr(A) + (1 cos )Tr(A2) = 3 + 0 + (1 cos )(2) = 1 + 2 cos

The 3 3 rotation matrix We therefore obtain cos = 1 (Tr(Q) 1) 2 From Q QT = [ I + A sin + A2(1 cos ) ] [ I A sin + A2(1 cos ) ] = 2A sin we can easily nd A and therefore also a: 1 (Q QT ) A= 2 sin

p. 7

Example 1: Calculate the rotation matrix Q that rotates all vectors in IR3 10 about the x axis. The x axis is spanned by the unit vector a = [1 0 0]T The cross product matrix A is therefore given by 0 a3 a2 0 0 0 a = 0 A= 3 0 1 0 a1 0 1 0 a2 a1 0

The 3 3 rotation matrix The rotation matrix Q is therefore given by Q = I + A sin + A2(1 cos ) = I + A sin 10 + A2(1 cos 10) 0 0 1 0 0.9848 0.1736 = 0 0.1736 0.9848 Verify that det(Q) = 1

p. 8

Let X be a 3 8 matrix of which the columns constitute the coordinates of the vertices of the box below left. The rotation matrix Q (above) is then applied once, twice and three times to the coordinates of the original box. The new coordinates are then plotted. The rotation axis is shown each time.
2 1.5 1 2 1.5 1 0.5

z-axis
1 0 -0.5 0 -1

0.5

z-axis

0 -0.5 -1 -1.5 -2 0.5

0 -0.5 -1 -1.5 -2 0.5 1 0 -0.5 0 -1

y-axis

x-axis

y-axis

x-axis

QX

The 3 3 rotation matrix


2 1.5 1 1.5 1 0.5

p. 9

z-axis

z-axis

0.5 0 -0.5 -1 -1.5 -2 1 0 1 -1 0 -1

0 -0.5 -1 -1.5

1 0 -1 0 -1 1

y-axis

x-axis

y-axis

x-axis

QQX

QQQX

Example 2: Show on your own that the rotation matrix Q that rotates all vectors in IR3 10 about the y axis, is given by 0.9848 0 0.1736 0 1 0 Q= 0.1736 0 0.9848

2 1.5 1 0.5 2 1.5 1 0.5

z-axis

0 -0.5 -1 -1.5 -2 1 1 0 -0.5 0 -1

z-axis

0 -0.5 -1 -1.5 -2 1 0.5 1 0 -0.5 0 -1

0.5

y-axis

x-axis

y-axis

x-axis

QX

The 3 3 rotation matrix

p. 10

2 1

2 1

z-axis

0 -1 -2 1 0.5 1 0 -0.5 0 -1

z-axis

0 -1 -2 1 0.5 0 0 -0.5 -1

y-axis

x-axis

y-axis

x-axis

QQX

QQQX

Example 3: Show on your own that the rotation matrix Q that rotates all vectors in IR3 10 about the z axis, is given by 0.1736 0 0.9848 Q = 0.1736 0.9848 0 0 0 1
2 1.5 1 0.5 2 1.5 1 0.5

z-axis

z-axis
1 0 -0.5 0 -1

0 -0.5 -1 -1.5 -2 0.5

0 -0.5 -1 -1.5 -2 0.5 1 0 -0.5 0 -1

y-axis

x-axis

y-axis

x-axis

QX

The 3 3 rotation matrix


2 1.5 1 0.5 2 1.5 1 0.5

p. 11

z-axis

z-axis
1 0 -0.5 0 -1

0 -0.5 -1 -1.5 -2 0.5

0 -0.5 -1 -1.5 -2 0.5 1 0 -0.5 0 -1

y-axis

x-axis

y-axis

x-axis

QQX

QQQX

Problem: Find the rotation angle and the rotation axis a when the rotation matrix Q is given by

Q=

17 25 2 3 5 6 25

2 3 5 1 2 3 3 10

6 25 3 3 10 41 50

3 1 Answer: = 60 ; a = 5 0 4

Potrebbero piacerti anche