1
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Do you have a question about math? $\endgroup$ – John Douma Jan 18 '19 at 3:34
  • $\begingroup$ My question is about matrices not the coding itself, I just put the link there for context. $\endgroup$ – DarkPotatoKing Jan 18 '19 at 3:39
  • $\begingroup$ Your question appears to be about some programming language. $\endgroup$ – John Douma Jan 18 '19 at 3:39
  • $\begingroup$ 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" $\endgroup$ – Ben Grossmann Jan 18 '19 at 3:42
  • 1
    $\begingroup$ @DarkPotatoKing It is used to represent affine transformations. (This is also hinted at in the page you linked.) $\endgroup$ – Alex Provost Jan 18 '19 at 3:45
5
$\begingroup$

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$.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.