#791 – Matrix Multiplication, Part I – Rows and Columns

To understand how WPF transforms points, it’s useful to know how to multiply two matrices together.

You can multiply one matrix (A) by another matrix (B) if the number of columns in A equals the number of rows in B.  The resulting matrix has the same number of rows as matrix A and the same number of columns as matrix B.

That is–multiplying an m x n matrix by an n x p matrix yields an m x p matrix.

Note: When describing the dimensions of a matrix, the first number refers to the number of rows and the second number refers to the number of columns.

For  example:

  • Multiplying a 2 x 3 matrix by a 3 x 1 matrix yields a 2 x 1 matrix
  • Multiplying a 2 x 2 matrix by a 2 x 1 matrix yields a 2 x 1 matrix
  • Multiplying a 3 x 3 matrix by a 3 x 1 matrix yields a 3 x 1 matrix

791-001