equation for the determinant of 3x3 matrix code example Example: matrix determinant for 2x2: a b c d ad - bc