You are on page 1of 16

Rotation about an Arbitrary Axis (Line)

R
Rotation
i about
b
an A
Arbitrary
bi
A
Axis
i (Li
(Line))
Z

P1

P1

P2

Z0

P0
X0

Y0

P0

x = Au + x0
y = Bu + y0

0 < =u <=1

z = Cu + z0
L = A2 + B 2 + C 2 u

B
A

AB

Step 1: Translate P0 to Origin O

P0 = [ xo yo zo ]T
0 0 x0
1 0 y0
0 1 z0

0 0
1

1
0
[D] =
0

P1(A,B,C)

A
P0

B
xx

Step
p 2: Rotate Vector about X Axis to g
get into the x - z p
plane
L = A2 + B 2 + C 2
V = B2 + C 2
B
sin 1 =
V
C
cos1 =
V
0
1
0 cos
1
[Rx ] =
0 sin 1

0
0

0
sin 1
cos1
0

1 0
0 C
0
0 V
=
0 0 B

1 V
0 0

0
B

V
C
V
0

Step
p 3: Rotate about the Y axis to g
get it in the Z direction
Rotate a negative angle (CW)!

A
sin 2 =
L
V
cos 2 =
L
cos 2
0
Ry =
sin 2

0 sin 2
1
0
0 cos 2
0

V
0 L

0 0
=

0
A

1 L
0

0
1
0
0

L
0
V
L
0

v
Step 4: Rotate angle about axis
L

cos
sin
[Rz ] =
0

sin
cos
0
0

0 0
0 0
1 0

0 1

Step 5: Reverse the rotation about the Y axis


V
L
0
1
Ry = A

L
0

[ ]

A
L
1 0
V
0
L
0 0
0

0
0

cox 2
0
Ry =
sin 2

[ ]

0 sin 2
1
0
0 cos 2
0
0

Inverse of Rotation:
Replace

by

sin

by

sin

cos remains cos (why?)

V
0
L
0 0
=
0 A

1 L
0

A
L
0
V
L
0

0
1
0
0

0
0

St 6:
Step
6 Reverse
R
rotation
t ti about
b t the
th X axis
i
1 0

C
0

1
R
[ x ] = VB
0
V

0 0
0
1
0 cos
1
[Rx ] =
0 sin 1

0
0

0
sin
i 1
cos1
0

0
B
V
C
V
0

1 0
0 C
0
0 V
=
0 0 B

1 V
0 0

0
B

V
C
V
0

Step 7: Reverse translation

[ D ]1

1 0

0 1
=
0 0

0 0

0 x0

0 y0

1 z0

0 1

Overall Transformation

[T ] = [ D] [ Rx ] [ Ry ] [ Rz ][ Ry ][ Rx ][ D]
P2 = [T ]P1

An Example
CCW

original
60
120

180

p1 p2 p3 p4

An Example
P1 =
Given the point matrix (four
points) on the right; and a line,
NM, with p
point N at ((6, -2, 0))
and point M at (12, 8, 0).

3 10 1 3
5 6 1 5
0 0 0 0
1 1 1 1

1. Calculate the constants


( h Line/Axis
(the
Li /A i off Rotation)
R
i )
x = 6 + 6u

Rotate the these four points 60


degrees around line NM (alone
the N to M direction) N: u=0;
M: u=1
Po = N
P1 = M

A = 12 6 = 6

y = 2 + 10u
z=0
Thus
A = 6, B = 10, C = 0

B = 8 (2)) = 10

L = A2 + B 2 + C 2 = 11.6619

C = 0 0 = 0

V = B 2 + C 2 = 10

2 Translate N to the origin


2.

3 Rotate about the X axis


3.

[D] = 1 0 0 -6
010 2
001 0
000 1

[R]x = 1 0 0 0
0 C/V -B/V 0
0 B/V C/V 0
0 0
0 1

4. Rotate about the Y axis

5. Rotate 60 degree (positive)

[R]y = V/L
0
A/L
0

[R]z = cos(60) -sin(60) 0 0


sin(60) cos(60) 0 0
0
0
1 0
0
0
0 1

0 -A/L 0
1 0 0
0 V/L 0
0
0 1

6. Reverse [R]y

7. Reverse [R]x

V/L 0 A/L 0
[R]y-1= 0 1 0 0
-A/L 0 V/L 0
0 0 0 1

1
[R]x-1= 0
0
0

8 Reverse the Translation


8.
1
[D]-11 = 0
0
0

0
1
0
0

0 6
0 -22
1 0
0 1

0
0 0
C/V B/V 0
-B/V
B/V C/V 0
0
0 1

9 Calculate
9.
C l l t the
th total
t t l transformation
t
f
ti

[T ] = [ D]1[ Rx ]1[ Ry ]1[ Rz60 ][ Ry ][ Rx ][ D]


P2 = [T ]P1
5.6471
[P]2 = 3.4118
3 4118
5.3468
1.0000
p1

10.2941 3.5000 5.6471


5 8235 -0.5000
5.8235
0 5000 3.4118
3 4118
0.5941 5.0498 5.3468
1.0000 1.0000 1.0000
p2

p3

p4

CCW

original
60
120

180

You might also like