[comp.graphics] Shearing with "basic" transforms.

sjr@datacube.UUCP (04/06/88)

Sorry.  Those transformations aren't as basic as you think.
What you want to do is impossible.  A convincing proof that
requires not too much matrix algebra can be sketched as follows:

Rotation Matrix:   

sin t  cos t  0
cos t  sin t  0
 0      0     1

Scale (or Reflection) Matrix:

Sx     0      0
0      Sy     0
0      0      1

Translation Matrix:

1      0      0
0      1      0
Tx     Ty     1

To simplify things a bit, convince yourself that no translation will
ever produce a shear.  Only Scales and Rotations remain.  Multiply
the Scale by the Rotation matrix (there are two ways to do this) to
get:

Sx sin t  Sx cos t    0
Sy cos t -Sy sin t    0
   0        0         1

or a similar matrix which gives similar results and is left as an
exercise to the reader.

Now, set that equal to your desired shear x matrix to get:

1)  Sx sin t = 1
2)  Sy cos t = SHx
3)  Sx cos t = 0
4)  Sy sin t - -1

In the case where your shear is non-zero (I assume this is the type of
shear you're interested in), the system is inconsistent.
(you get sin t = 1/0).  


You can, if you're interested, get rotations from just shears.  This
is actually a fast way to do rotations.  But the other way just don't
work.