1

I'm coding using p5.js and I'm looking at this method https://p5js.org/reference/#/p5/applyMatrix

Using that method, I can multiply my current matrix with any matrix of the form:

$$ \begin{pmatrix} a & c & e \\ b & d & f \\ 0 & 0 & 1 \\ \end{pmatrix} $$

by calling applyMatrix(a, b, c, d, e, f)

There is no method for multiplying any arbitrary matrix like: $$ \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{pmatrix} $$

Is there anything special with a matrix of that form? Is it possible to convert any arbitrary matrix (like the bottom matrix) into a matrix of that form?

Alex Provost
  • 20,991
  • Do you have a question about math? – John Douma Jan 18 '19 at 03:34
  • My question is about matrices not the coding itself, I just put the link there for context. – DarkPotatoKing Jan 18 '19 at 03:39
  • Your question appears to be about some programming language. – John Douma Jan 18 '19 at 03:39
  • You could fit your $3 \times 3$ matrix into the larger matrix $$ \pmatrix{1&2&3&0\4&5&6&0\7&8&9&0\0&0&0&1} $$ which I would say is a "matrix of that form" – Ben Grossmann Jan 18 '19 at 03:42
  • My question is about whether there's something special about a matrix of a certain form, which is a purely math question. The context is that the programming language I use uses that form so I'm asking if there's anything mathematically special about it. – DarkPotatoKing Jan 18 '19 at 03:43
  • 1
    @DarkPotatoKing It is used to represent affine transformations. (This is also hinted at in the page you linked.) – Alex Provost Jan 18 '19 at 03:45

1 Answers1

5

It is a standard way to represent an affine transformation of the plane; this is how it is used on the page you linked. The submatrix $A = \begin{pmatrix} a & c \\ b & d \end{pmatrix}$ in your question represents the linear part of the affine transformation, and the extra column $t = \begin{pmatrix} e \\ f \end{pmatrix}$ to the right corresponds to the translation part of the transformation. In full, the corresponding transformation maps a vector $v$ to the vector $Av + t$.

Alex Provost
  • 20,991