Graphics Programs Reference
In-Depth Information
rotate
about
origin
translate back
translate
rotate
(a)
(b)
(c)
Figure 1.6: Rotation About a Point.
(because 2
α
2
=sin
2
45
◦
+cos
2
45
◦
= 1). Note that det
T
=
−
1 (i.e., pure reflection).
Exercise 1.13:
Show that the result in the example is correct.
Example: Reflection about an arbitrary line
. Given the line
y
=
ax
+
b
,
it is possible to reflect a point about this line by transforming the line to the
x
axis,
reflecting about that axis, and transforming the line back. Since
a
is the slope (i.e., the
tangent of the angle
α
between the line and the
x
axis) and
b
is the
y
intercept, the
individual transformations needed are (1) a translation of
b
units in the
y
direction, (2)
a clockwise rotation of
α
degrees about the origin, (3) a reflection about the
x
axis, (4) a
counterclockwise rotation, and (5) a reverse translation. The combined transformation
matrix is therefore
−
⎛
⎞
⎛
⎞
⎛
⎞
100
010
0
cos
α
−
sin
α
0
100
0
⎝
⎠
⎝
⎠
⎝
⎠
T
reflect
=
sin
α
cos
α
0
10
001
−
−
b
1
0
0
1
⎛
⎞
⎛
⎞
cos
α
sin
α
0
100
010
0
⎝
⎠
⎝
⎠
×
−
sin
α
cos
α
0
0
0
1
b
1
⎛
⎞
cos(2
α
) si (2
α
)0
sin(2
α
)
−
cos(2
α
)0
−b
sin(2
α
)
b
cos
2
α
⎝
⎠
.
=
(1.9)
1
The determinant of this transformation matrix equals
1, as should be for pure reflec-
tion. For the two special cases
α
=
b
=0and
α
=45
◦
−
and
b
= 0, Equation (1.9)
becomes
Search WWH ::
Custom Search