Friday, February 10, 2023

JavaScript transformation

 Transformation is a matrix of 3x3, that you can change the rotate, scale and translate.

When is talking about matrix you can read what is in about mathematic matrix to have more acknowledgment about the subject.

So we have 3 transformation for JS programming:

1 - scale; 2 - translate; 3 - rotation;

See that table

            a        c        e

            b        d        f

            0        0        1

This is the transformation matrix that let, so the method is: ctx.transform(a,b,c,d,e,f).

the identity matrix is:

            1        0        0

            0        1        0

            0        0        1

The 2 lines marked id what the methods parameters the last line is that an matrix is a number elevated to 2, so we can't have a matrix of 3x2 but one 3x3.




Continuos in the next article.
Rute Bezerra de Menezes Gondim

No comments:

Post a Comment