## Calculate determinant

The formula for calculating a 3x3 determinant is

\ (\ begin {align *} | A | = \ begin {vmatrix} a & b & c \ d & e & f \ g & h & i \ end {vmatrix} & = a \ cdot e \ cdot i + b \ cdot f \ cdot g + c \ cdot d \ cdot h \ & \ quad -g \ cdot e \ cdot c - h \ cdot f \ cdot a - i \ cdot d \ cdot b \ end {align * } \)

Examples

\ (\ begin {align *} | A | & = \ begin {vmatrix} 1 & 2 & 3 \ 4 & 5 & 6 \ 7 & 8 & 9 \ end {vmatrix} \ & = 1 \ cdot 5 \ times 9 + 2 \ times 6 \ times 7 + 3 \ times 4 \ times 8 \ & \ times 8 \ times \ times 5 \ times 3 - 8 \ times 6 \ times 1 - 9 \ times 4 \ times 2 \ & = 45 + 84 + 96 - 105 - 48 - 72 \ & = 0 \ \ end {align *} \)

\ (\ begin {align *} | B | & = \ begin {vmatrix} 2 & 5 & 2 \ 3 & -3 & 1 \ 1 & 4 & -4 \ end {vmatrix} \ & = 2 \ cdot (-3) \ cdot (-4) + 5 \ times 1 \ times 1 + 2 \ times 3 \ times 4 \ & \ quad - 1 \ times (-3) \ times 2 - 4 \ times \ times 1 \ times 2 - (-4) \ times 3 \ times 5 \ & = 24 + 5 + 24 - (-6) - 8 - (-60) \ & = 111 \ \ end {align *} \)