Calculate determinant of $3 \times 3$ matrix (#677)