Another common operation applied to a matrix is known as the transpose of the matrix, or in mathematical terms, AT.

The transpose is defined for matrices of any size and flips all elements along the main diagonal, inverting the columns and rows. For instance, a 4×3 matrix would become a 3×4 matrix.


A few things to notice here. First, the elements on the diagonal stay the same. Second, the elements maintain their order relative to each other. The first column reads [159]and the first row of the transposed matrix also reads (1,5,9).

Third, the transpose of a transpose is itself:


Consider the case of a square matrix that is transposed. What would the resulting transformation look like? Take for instance, this transformation which rotates and scales an area.


When we flip along the diagonal, we still get a rotation (we do not get a transformation that undoes the rotation), but it is curiously in the opposite direction.


The same sort of effect happens in three dimensions too. Take this matrix which rotates around the y axis by about thirty degrees and scales on the y axis by 2.

The transpose of this matrix rotates around the y axis by negative thirty degrees, but still scales on the y axis by 2.

We say that then that the transpose is the contravariant transformation. Instead of vectors transforming with the matrix, they are transformed against it.

What happens if we premultiply a matrix by its own transpose?


Notice that the result shows that we have covariant scaling on the y axis and everything else on the other two axes just has a unit covariance.