<< Chapter < Page | Chapter >> Page > |
Often we will want to perform several operations on an object before we display the result. For example, suppose we want to rotate by and reduce to size in each dimension:
If there are points in the matrix , it will require multiplications to perform each of these operations, for a total of multiplications. However, we can save some multiplications by noting that
where
In other words, we take advantage of the fact that matrix multiplication is associative to combine and into a single operation , which requires only 8 multiplications. Then we operate on with , which requires multiplications. By “composing” the two operations, we have reduced the total from to 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
Figure 1 shows a square being stretched along a 45 o line. The composite operator that performs this directional stretching is
Note that the rightmost operator in a product of operators is applied first.
Notification Switch
Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?