2. Rotation about an Arbitrary Axis (Line)
X
Y
Z
X0X0
Y0
Z0
L
P2
P1
P0
L
AB
C
uCBAL
zCuz
yBuy
xAux
222
0
0
0
++=
+=
+=
+=
0 < =u <=1
P0
O
P1
A
B
C
L
3. Step 1: Translate Point P0 to Origin O
[ ]
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
−
−
−
=
1000
100
010
001
0
0
0
z
y
x
D
x
z
y
O
P0
P1(A,B,C)
A
B
0 [ ]T
o o oP x y z=
C
4. Step 2: Rotate Vector about X Axis to get into the x - z plane
V
C
V
B
CBV
CBAL
=
=
+=
++=
1
1
22
222
cos
sin
θ
θ
[ ]
⎥
⎥
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎢
⎢
⎣
⎡
−
=
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
−
=
1000
00
00
0001
1000
0cossin0
0sincos0
0001
11
11
V
C
V
B
V
B
V
C
Rx
θθ
θθ
X
V
L
5. Step 3: Rotate about the Y axis to get it in the Z direction
Rotate a negative angle (CW)!
L
V
L
A
=
−=
2
2
cos
sin
θ
θ
2 2
2 2
0 0
cos 0 sin 0
0 1 0 0 0 1 0 0
sin 0 cos 0
0 0
0 0 0 1
0 0 0 1
y
V A
L L
R
A V
L L
θ θ
θ θ
⎡ ⎤
−⎢ ⎥⎡ ⎤
⎢ ⎥⎢ ⎥
⎢ ⎥⎢ ⎥⎡ ⎤ = =⎣ ⎦ ⎢ ⎥⎢ ⎥−
⎢ ⎥⎢ ⎥
⎢ ⎥⎣ ⎦
⎢ ⎥⎣ ⎦
7. Step 5: Reverse the rotation about the Y axis
[ ]
⎥
⎥
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎢
⎢
⎣
⎡
−
=
−
1000
00
0010
00
1
L
V
L
A
L
A
L
V
Ry [ ]
⎥
⎥
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎢
⎢
⎣
⎡
−
=
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
−
=
1000
00
0010
00
1000
0cos0sin
0010
0sin0cos
22
22
L
V
L
A
L
A
L
V
Ry
θθ
θθ
Inverse of Rotation:
Replace θ by – θ
sin θ by – sin θ
cos θ remains cos θ (why?)
8. Step 6: Reverse rotation about the X axis
Rx[ ]−1
=
1 0 0 0
0
C
V
B
V
0
0 −
B
V
C
V
0
0 0 0 1
⎡
⎣
⎢
⎢
⎢
⎢
⎢
⎢
⎤
⎦
⎥
⎥
⎥
⎥
⎥
⎥
[ ]
⎥
⎥
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎢
⎢
⎣
⎡
−
=
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
−
=
1000
00
00
0001
1000
0cossin0
0sincos0
0001
11
11
V
C
V
B
V
B
V
C
Rx
θθ
θθ
12. An Example 3 10 1 3
[P1]= 5 6 1 5
0 0 0 0
1 1 1 1Given the point matrix (four
points) on the right; and a line,
NM, with point N at (6, -2, 0)
and point M at (12, 8, 0).
Rotate the these four points 60
degrees around line NM (alone
the N to M direction) N: u=0;
M: u=1
10
6619.11
0,10,6
Thus
0
102
66
22
222
=+=
=++=
===
=
+−=
+=
CBV
CBAL
CBA
z
uy
ux
1. Calculate the constants
(the Line/Axis of Rotation)
P1 P2 P3 P4
12 6 6
8 ( 2) 10
0 0 0
A
B
C
= − =
= − − =
= − =
1
oP N
P M
=
=
15. 9. Calculate the total transformation
5.6471 10.2941 3.5000 5.6471
[P]2 = 3.4118 5.8235 -0.5000 3.4118
5.3468 0.5941 5.0498 5.3468
1.0000 1.0000 1.0000 1.0000
1 1 1 60
2 1
[ ] [ ] [ ] [ ] [ ][ ][ ][ ]
[ ]
x y z y xT D R R R R D
TP
R
P
− − −
=
=
P1 P2 P3 P4