
17.5 The Curse of Nonuniform Scaling 779
where R is a rotation matrix and S is a scaling matrix, diagonal and with positive
diagonal entries. The technical problem, and one many programmers do not expect,
is that it is not always possible to factor M in this manner.
Example
17.1
Consider the attempt to factor the following matrix:
M =
11
01
= RS =
cos θ − sin θ
sin θ cos θ
d
0
0
0 d
1
=
d
0
cos θ −d
1
sin θ
d
0
sin θd
1
cos θ
where d
0
> 0 and d
1
> 0. Equating the off-diagonal terms, we have 0 = d
0
sin θ and
1 =−d
1
sin θ . Since d
0
> 0, the first equation forces sin θ = 0. The second equation
does not allow sin θ = 0. Even if you allowed d
0
= 0, the equation d
0
cos θ =1