(a, b)
| 7 | // The first transform applied is a, followed by b, which |
| 8 | // is normally written b * a. |
| 9 | function multiply(a, b) { |
| 10 | return [ |
| 11 | [ a[0][0] * b[0][0] + a[0][1] * b[1][0], a[0][0] * b[0][1] + a[0][1] * b[1][1], a[0][0] * b[0][2] + a[0][1] * b[1][2] + a[0][2] ], |
| 12 | [ a[1][0] * b[0][0] + a[1][1] * b[1][0], a[1][0] * b[0][1] + a[1][1] * b[1][1] + 0, a[1][0] * b[0][2] + a[1][1] * b[1][2] + a[1][2] ] |
| 13 | ] |
| 14 | } |
| 15 | |
| 16 | // Creates a "move" transform. |
| 17 | function move(x, y) { |