A class representing a 2x2 [link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix].
const m = new Matrix2();
The constructor and [page:set]() method take arguments in
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major]
order, while internally they are stored in the [page:.elements elements]
array in column-major order.
This means that calling
m.set( 11, 12,
21, 22 );
will result in the [page:.elements elements] array containing:
m.elements = [ 11, 21,
12, 22 ];
and internally all calculations are performed using column-major ordering.
However, as the actual ordering makes no difference mathematically and
most people are used to thinking about matrices in row-major order, the
three.js documentation shows matrices in row-major order. Just bear in
mind that if you are reading the source code, you'll have to take the
[link:https://en.wikipedia.org/wiki/Transpose transpose] of any matrices
outlined here to make sense of the calculations.
Creates a 2x2 matrix with the given arguments in row-major order. If no arguments are provided, the constructor initializes the [name] to the 3x3 [link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
A [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major] list of matrix values.
[page:Array array] - the array to read the elements from.
[page:Integer offset] - (optional) index of first element in the array.
Default is `0`.
Sets the elements of this matrix based on an array in
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
Resets this matrix to the 2x2 identity matrix:
Sets the 2x2 matrix values to the given [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order row-major] sequence of values:
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]