freeCodeCamp/guide/english/mathematics/3-by-3-determinants/index.md

7.2 KiB

title
3 by 3 Determinants

3 by 3 Determinants

3x3 determinants are a value that can be calculated by the values in a matrix. It is also known as the scaling factor of the linear transformation that the matrix represents. When a 3x3 matrix and its rows are comprised of three vectors, the determinant of this 3x3 matrix is the volume of the parallelepiped that is made up of these three vectors.

Calculation

Method 1

Consider the following matrix, which we will call A:

a b c
d e f
g h i

Then the determinant of this matrix, denoted det(A), is given by:

det(A) = a * (e * i - h * f) - b * (d * i - f * g) + c * (d * h - e * g)

Please keep in mind the order of operations in the expression above.

For example, consider the following matrix, which we will call B:

1 2 3
0 -3 5
-10 4 7

det(B) is given by the formula above. We apply the formula below:

det(B) = 1 * ( (-3) * 7 - 5 * 4) - 2 * ( 0 * 7 - 5 * (-10)) + 3 * (0 * 4 - (-3) * (-10))

, which we simplify to:

det(B) = 1 * ((-21) - 20) - 2 * (0 - (-50)) + 3 * (0 - (30))

, which we simplify to:

det(B) = (-41) - 100 - 90 = -231

Method 2 - Sarrus's Rule

This method it similar to 2 by 2 determinants, and based on opertations with diagonals Again, consider the following matrix, which we will call A:

a b c
d e f
g h i

Then the determinant of this matrix, denoted det(A), is given by:

det(A) = a * e * i + b * f * g + c * d * h - c * e * g - f * h * a - i * b * d

Note how three top-right to bottom-left diagonals are positive

a
e
i
b
f
g
c
d
h

Top-left to bottom-right are negative

c
e
g
a
f
h
b
d
i

Consider the same example as in method 2: matrix, which we will call B:

1 2 3
0 -3 5
-10 4 7

det(B) is given by the formula above. We apply the formula below:

det(B) = 1 * (-3) * 7 + 2 * 5 * (-10) + 3 * 0 * 4 - 3 * (-3) * (-10) - 5 * 4 * 1 - 7 * 2 * 0

, which we simplify to:

det(B) = -21 - 100 + 0 - 90 - 20 - 0 = -231

Which is the same as in method 1

More information: