Graphics Programs Reference
In-Depth Information
1.2.11 A Note
All the expressions derived so far for transformations are based on the basic relation
P
∗
=
PT
. Some authors prefer the equivalent relation
P
∗
=
TP
, which changes the
mathematics somewhat. If we want the coordinates of the transformed point to be the
same as before (i.e.,
x
∗
=
ax
+
cy
+
m
,
y
∗
=
bx
+
dy
+
n
), we have to write the relation
P
∗
=
TP
in the form
⎛
⎞
⎛
⎞
⎛
⎞
x
∗
y
∗
1
acm
bdn
00 1
x
y
1
⎝
⎠
=
⎝
⎠
⎝
⎠
.
The first difference is that both
P
and
P
∗
are columns instead of rows. This is because of
the rules of matrix multiplication. The second difference is that the new transformation
matrix
T
is the transpose of the original one. Hence, rotation, for example, is achieved
by the matrices
⎛
⎞
cos
θ
sin
θ
0
⎝
⎠
−
sin
θ
cos
θ
0
0
0
1
for a clockwise rotation, and
⎛
⎞
cos
θ
−
sin
θ
0
⎝
⎠
sin
θ
cos
θ
0
0
0
1
for a counterclockwise rotation.
⎛
⎝
⎞
⎠
⎛
⎝
⎞
⎠
.
10
m
01
n
00 1
100
010
mn
1
Similarly, translation is done by
instead of
1.2.12 Summary
The general two-dimensional a
ne transformation is given by
x
∗
=
ax
+
cy
+
m
,
y
∗
=
bx
+
dy
+
n
. This section shows the values or constraints that should be assigned to the
four coe
cients
a
,
b
,
c
,and
d
in order to obtain certain types of transformations (we
ignore translations).
A general a
ne transformation is obtained when
ad
−
bc
=0. For
ad
−
bc
=+1,
the transformation is rotation, and for
ad
−
bc
=
−
1, it is reflection.
The case
ad
−
bc
= 0 corresponds to a singular transformation.
The identity transformation is obtained when
a
=
d
=1and
b
=
c
=0.
An isometry is obtained by
a
2
+
b
2
=
c
2
+
d
2
=1and
ac
+
bd
=0. Anisometryisa
transformation that preserves distances. If
P
and
Q
are two points on an object, then
the distance
d
between them is preserved, meaning that the distance
d
between
P
∗
and
Q
∗
is the same. Rotations, reflections, and translations are isometries.
Search WWH ::
Custom Search