이 API는 실험적입니다
향후 p5.js 버전에서 동작이 변경될 수 있습니다.
Creates a 2x2 matrix inside a p5.strands shader callback.
A 2x2 matrix can rotate, scale, and slant a two-component vector, but it has no room to store a move, so there is no transform alias for it. Use transform2D() to also move points around.
Called without arguments it returns the identity matrix. It can also be called with a single number, which fills the diagonal; a single matrix, which is resized; 2 column vectors; or 4 values in column-major order.
Note: mat2() can only be used inside a p5.strands shader callback.
예제
구문
mat2(values1, values2, ..., valuesn)
매개변수
values1, ..., valuesn
Number: nothing for the identity matrix, one number, one matrix, 2 column vectors, or 4 values in column-major order.
반환값
a 2x2 matrix.
Notice any errors or typos? Please let us know. Please feel free to edit src/strands/strands_transform.js and open a pull request!