36 Applied Geometry for Computer Graphics and CAD
EXERCISES
2.22. Show that the concatenation of two rotations, the first through
an angle θ about a point P(x
0
,y
0
) and the second about a point
Q(x
1
,y
1
) (distinct from P) through an angle −θ, is equivalent to a
translation.
2.23. Determine the transformation matrix of a reflection in the line 5x −
2y + 8 = 0. Express the reflection first using (2.11) and then as a
concatenation of transformations (2.9).
2.24. Demonstrate that if the coordinates of points are expressed by ra-
tional numbers (whole numbers and fractions), then a reflection in
a line defined by rational coefficients a, b, c can be computed using
integer arithmetic.
2.25. Use trigonometry to verify the result used in the derivation of
(2.11) that if tan θ = −a/b,thensinθ = a/
a
2
+ b
2
1/2
and
cos θ = −b/
a
2
+ b
2
1/2
.
2.6 Applications
2.6.1 Instancing
In Section 1.8.1 the model of the front of a house was defined by instancing
the picture element Square with vertices (0, 0), (1, 0), (1, 1), and (0, 1). The
front door was obtained by applying a scaling of 0.5 units in the x-direction,
followed by a translation of 3 units in the x-direction and 1 unit in the y-
direction. Transformations applied to picture elements and primitives to obtain
instances are called modelling transformations. The front door is obtained from
Square by applying the modelling transformation S(1, 3) ◦ T(4, 0) which has
the modelling transformation matrix
S(1, 3)T(4, 0) =
⎛
⎝
0.500
010
001
⎞
⎠
⎛
⎝
100
010
311
⎞
⎠
=
⎛
⎝
0.500
010
311
⎞
⎠
.
The vertices of the door are obtained by applying the modelling transformation
matrix to the vertices of the Square primitive, giving
⎛
⎜
⎜
⎝
001
101
111
011
⎞
⎟
⎟
⎠
⎛
⎝
100
010
311
⎞
⎠
=
⎛
⎜
⎜
⎝
311
411
421
321
⎞
⎟
⎟
⎠
.
So in world coordinates the vertices are (3, 1), (4, 1), (4, 2) and (3, 2).