Graphics Programs Reference
In-Depth Information
y
j
θ
x
θ
i
Figure 1.8: Scaling Along Rotated Axes.
Exercise 1.24:
Discuss scaling relative to a point (
x
0
,y
0
), and show that the result
is identical to the product of a translation followed by scaling, followed by a reverse
translation.
Using Equation (Ans.2) in the Answers to Exercises, it is easy to explore the effect
of two consecutive scaling transformations, with scaling factors of
k
1
and
k
2
and about
points
P
1
=(
x
1
,y
1
)and
P
2
=(
x
2
,y
2
), respectively.
We simply multiply the two
transformation matrices
⎛
⎞
⎛
⎞
k
1
0
0
k
2
0
0
⎝
⎠
⎝
⎠
0
k
1
0
0
k
2
0
x
1
(1
− k
1
)
y
1
(1
− k
1
)1
x
2
(1
− k
2
)
y
2
(1
− k
2
)1
⎛
⎞
k
1
k
2
0
0
⎝
⎠
.
=
0
k
1
k
2
0
(1.16)
k
2
(1
−
k
1
)
x
1
+(1
−
k
2
)
x
2
k
2
(1
−
k
1
)
y
1
+(1
−
k
2
)
y
2
1
The result is similar to Equation (Ans.2) except for the bottom row. It seems that the
product of two scalings is a third scaling with a factor
k
1
k
2
, but about what point? To
write Equation (1.16) in the form of Equation (Ans.2), we write
k
2
(1
−
k
1
)
x
1
+(1
−
k
2
)
x
2
=
x
c
(1
−
k
1
k
2
)
,
k
2
(1
−
k
1
)
y
1
+(1
−
k
2
)
y
2
=
y
c
(1
−
k
1
k
2
)
,
and solve for (
x
c
,y
c
), obtaining
x
c
=
k
2
(1
−
k
1
)
x
1
+(1
−
k
2
)
x
2
,
1
−
k
1
k
2
y
c
=
k
2
(1
−
k
1
)
y
1
+(1
−
k
2
)
y
2
.
1
−
k
1
k
2
The center of the double scaling is therefore point
P
c
=
k
2
(1
−
k
1
)
1
−
k
2
P
1
+
k
1
k
2
P
2
=
a
P
1
+
b
P
2
.
1
−
k
1
k
2
1
−
Search WWH ::
Custom Search