Matrix multiplication is a way to compose linear transformations. The result of passing a vector to the composed transformation function is the same as passing a vector to the first matrix which produces an output and then passing that output to the second matrix. For the example shown above, here is how the matrix elements are calculated: