Function determinant

determinant(A) takes a $2 \times 2$, $3 \times 3$, or $4 \times 4$ matrix $A$, and returns its determinant $\text{det}(A)$.