Game Development Reference
In-Depth Information
selecting row i, the determinant can be computed by
Computing an n × n
determinant by using
cofactors of row i
n
n
{ij}
m ij (−1) i+j M
{ij}
| M | =
m ij C
=
.
(6.5)
j=1
j=1
As it turns out, it doesn't matter which row or column we choose; they all
will produce the same result.
Let's look at an example. We'll rewrite the equation for 3 × 3 determi-
nant using Equation (6.5):
m 11 m 12 m 13
Recursive definition of
determinant applied to
3 × 3 case
m 22 m 23
m 32 m 33
m 21 m 23
m 31 m 33
m 21 m 22 m 23
m 31 m 32 m 33
= m 11
− m 12
m 21 m 22
m 31 m 32
+ m 13
.
Now, let's derive the 4 × 4 matrix determinant:
= m 11
m 22 m 23 m 24
m 11 m 12 m 13 m 14
m 21 m 22 m 23 m 24
m 31 m 32 m 33 m 34
m 41 m 42 m 43 m 44
Recursive definition of
determinant applied to
4 × 4 case
m 32 m 33 m 34
m 42 m 43 m 44
m 21 m 23 m 24
m 21 m 22 m 24
− m 12
m 31 m 33 m 34
m 41 m 43 m 44
+ m 13
m 31 m 32 m 34
m 41 m 42 m 44
m 21 m 22 m 23
− m 14
m 31 m 32 m 33
m 41 m 42 m 43
.
Expanding the cofactors, we have
m 11
m 22 (m 33 m 44 −m 34 m 43 ) + m 23 (m 34 m 42 −m 32 m 44 ) + m 24 (m 32 m 43 −m 33 m 42 )
Determinant of a 4 × 4
matrix in expanded form
− m 12
m 21 (m 33 m 44 −m 34 m 43 ) + m 23 (m 34 m 41 −m 31 m 44 ) + m 24 (m 31 m 43 −m 33 m 41 )
+ m 13
m 21 (m 32 m 44 −m 34 m 42 ) + m 22 (m 34 m 41 −m 31 m 44 ) + m 24 (m 31 m 42 −m 32 m 41 )
− m 14
m 21 (m 32 m 43 −m 33 m 42 ) + m 22 (m 33 m 41 −m 31 m 43 ) + m 23 (m 31 m 42 −m 32 m 41 )
.
As you can imagine, the complexity of explicit formulas for determinants
of higher degree grows rapidly. Luckily, we can perform an operation known
as “pivoting,” which doesn't affect the value of the determinant, but causes
a particular row or column to be filled with zeroes except for a single element
(the “pivot” element). Then only one cofactor has to be evaluated. Since
we won't need determinants of matrices higher than the 4×4 case, anyway,
a complete discussion of pivoting is outside the scope of this topic.
Search WWH ::




Custom Search