This module is part of the collection, A First Course in Electrical and Computer Engineering. The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.
Often we will want to perform several operations on an object before we
display the result. For example, suppose we want to rotate by π3π3 and reduce
to 1212 size in each dimension:
G
1
=
R
(
π
3
)
G
G
n
e
w
=
S
(
1
2
,
1
2
)
G
1
.
G
1
=
R
(
π
3
)
G
G
n
e
w
=
S
(
1
2
,
1
2
)
G
1
.
(1)
If there are
n
n points in the matrix
G
G, it will require 4n4n multiplications to
perform each of these operations, for a total of 8n8n multiplications. However,
we can save some multiplications by noting that
G
n
e
w
=
S
(
1
2
,
1
2
)
[
R
(
π
3
)
G
]
=
A
G
G
n
e
w
=
S
(
1
2
,
1
2
)
[
R
(
π
3
)
G
]
=
A
G
(2)
where
A
=
S
(
1
2
,
1
2
)
R
(
π
3
)
=
1
2
c
o
s
(
π
3
)
-
1
2
s
i
n
(
π
3
)
1
2
s
i
n
(
π
3
)
l
2
c
o
s
(
π
3
)
.
A
=
S
(
1
2
,
1
2
)
R
(
π
3
)
=
1
2
c
o
s
(
π
3
)
-
1
2
s
i
n
(
π
3
)
1
2
s
i
n
(
π
3
)
l
2
c
o
s
(
π
3
)
.
(3)
In other words, we take advantage of the fact that matrix multiplication is
associative to combine
S
S and
R
R into a single operation
A
A, which requires
only 8 multiplications. Then we operate on
G
G with
A
A, which requires 4n4n
multiplications. By “composing” the two operations, we have reduced the
total from 8n8n to 4n+84n+8 multiplications. Furthermore, we can now build
operators with complex actions by combining simple actions.
We can build an operator that stretches objects along a
diagonal line by composing scaling and rotation. We must
- rotate the diagonal line to the x-axis with R(-θ)R(-θ);
- scale with S(s,1)S(s,1); and
- rotate back to the original orientation with R(θ)R(θ).
Figure 1 shows a square being stretched along a 45o line. The composite
operator that performs this directional stretching is
A
(
θ
,
s
)
=
R
(
θ
)
S
(
s
,
1
)
R
(
-
θ
)
=
c
o
s
θ
-
s
i
n
θ
s
i
n
θ
c
o
s
θ
s
0
0
1
c
o
s
θ
s
i
n
θ
-
s
i
n
θ
c
o
s
θ
=
s
c
o
s
2
θ
+
s
i
n
2
θ
(
s
-
1
)
s
i
n
θ
c
o
s
θ
(
s
-
1
)
s
i
n
θ
c
o
s
θ
c
o
s
2
θ
+
s
s
i
n
2
θ
.
A
(
θ
,
s
)
=
R
(
θ
)
S
(
s
,
1
)
R
(
-
θ
)
=
c
o
s
θ
-
s
i
n
θ
s
i
n
θ
c
o
s
θ
s
0
0
1
c
o
s
θ
s
i
n
θ
-
s
i
n
θ
c
o
s
θ
=
s
c
o
s
2
θ
+
s
i
n
2
θ
(
s
-
1
)
s
i
n
θ
c
o
s
θ
(
s
-
1
)
s
i
n
θ
c
o
s
θ
c
o
s
2
θ
+
s
s
i
n
2
θ
.
(4)Note that the rightmost operator in a product of operators is applied first.
"Reviewer's Comments: 'I recommend this book as a "required primary textbook." This text attempts to lower the barriers for students that take courses such as Principles of Electrical Engineering, […]"