Game Development Reference
In-Depth Information
Applying the general matrix multiplication formula to the 3 × 3 case
produces
2
3
2
3
a
11
a
12
a
13
a
21
a
22
a
23
a
31
a
32
a
33
b
11
b
12
b
13
b
21
b
22
b
23
b
31
b
32
b
33
3 × 3 matrix
multiplication
4
5
4
5
AB
=
a
11
b
11
+ a
12
b
21
+ a
13
b
31
a
11
b
12
+ a
12
b
22
+ a
13
b
32
a
11
b
13
+ a
12
b
23
+ a
13
b
33
=
.
a
21
b
11
+ a
22
b
21
+ a
23
b
31
a
21
b
12
+ a
22
b
22
+ a
23
b
32
a
21
b
13
+ a
22
b
23
+ a
23
b
33
a
31
b
11
+ a
32
b
21
+ a
33
b
31
a
31
b
12
+ a
32
b
22
+ a
33
b
32
a
31
b
13
+ a
32
b
23
+ a
33
b
33
Here is a 3 × 3 example with some real numbers:
2
3
2
4
−8
3
1
−5
3
6
1
4
5
5
A
=
0
−2
6
,
B
=
7
0
−3
;
7
2
−4
2
4
5
2
3
2
4
−8
3
1
−5
3
6
1
4
5
5
AB
=
0
−2
6
7
0
−3
7
2
−4
2
4
5
1(−8) + (−5)7 + 32
16 + (−5)0 + 34
11 + (−5)(−3) + 35
=
0(−8) + (−2)7 + 62
06 + (−2)0 + 64
01 + (−2)(−3) + 65
7(−8) + 27 + (−4)2
76 + 20 + (−4)4
71 + 2(−3) + (−4)5
2
4
−37
3
18
31
5
=
−2
24
36
.
−50
26
−19
Beginning in Section 6.4 we also use 4 × 4 matrices.
A few notes concerning matrix multiplication are of interest:
•
Multiplying any matrix
M
by a square matrix
S
on either side results
in a matrix of the same size as
M
, provided that the sizes of the
matrices are such that the multiplication is allowed. If
S
is the identity
matrix
I
, then the result is the original matrix
M
:
MI
=
IM
=
M
.
(That's the reason it's called the identity matrix!)
•
Matrix multiplication is not commutative. In general,
AB
=
BA
.
•
Matrix multiplication is associative:
(
AB
)
C
=
A
(
BC
).
Search WWH ::
Custom Search