A **triangular matrix** is a special square matrix in which all the entries either below (in which case it is called an **upper triangular matrix**) or above (in which case it is called a **lower triangular matrix**) the main diagonal are zero. A special case of a triangular matrix is a diagonal matrix, in which all entries except those on the main diagonal are zero.

One of the most useful properties of triangular matrices is that the determinant of the matrix will be equal to the product of the diagonal entries (therefore, if a triangular matrix has one zero on the diagonal, the determinant will be zero).

## Examples

- $ A = \begin{bmatrix} 3 & 8 & 7 \\ 0 & 5 & 1 \\ 0 & 0 & 1 \\ \end{bmatrix} ~~ B = \begin{bmatrix} 8 & 0 & 0 \\ 5 & 5 & 0 \\ 1 & 8 & 3 \\ \end{bmatrix} ~~ C = \begin{bmatrix} 4 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 7 \\ \end{bmatrix} $

*A* is an upper triangular matrix, *B* is a lower triangular matrix, and *C* is a diagonal matrix.

Community content is available under CC-BY-SA
unless otherwise noted.