2D affine transformation matrix
Illustration of the effect of applying various 2D affine transformation matrices on a unit square by CMG Lee. Note that the reflection matrices are special cases of the scaling matrix.
0
0
1
1
0
1
x
y
(1,0)
(0,1)
(0,0)
No change
1
0
0
1
0
0
(X,Y)
Translate
1
0
0
1
X
Y
(W,0)
(0,H)
Scale about origin
W
0
0
H
0
0
(cos θ, -sin θ)
(sin θ, cos θ)
θ
Rotate about origin
cos θ
-sin θ
sin θ
cos θ
0
0
0
0
1
(1,0)
(A,1)
Shear in x direction
1
0
A
1
0
0
(1,B)
(0,1)
Shear in y direction
1
B
0
1
0
0
(-1,0)
(0,-1)
Reflect about origin
-1
0
0
-1
0
0
(1,0)
(0,-1)
Reflect about x-axis
1
0
0
-1
0
0
(-1,0)
(0,1)
Reflect about y-axis
-1
0
0
1
0
0