API / Matrix
Class: Matrix
Defined in: geom/Matrix.ts:31
2D Transform matrix.
Properties
a
a: number;
Defined in: geom/Matrix.ts:40
The value that affects the positioning of pixels along the x axis when scaling or rotating an image.
Default
1.0
b
b: number;
Defined in: geom/Matrix.ts:49
The value that affects the positioning of pixels along the y axis when rotating or skewing an image.
Default
0.0
c
c: number;
Defined in: geom/Matrix.ts:58
The value that affects the positioning of pixels along the x axis when rotating or skewing an image.
Default
0.0
d
d: number;
Defined in: geom/Matrix.ts:67
The value that affects the positioning of pixels along the y axis when scaling or rotating an image.
Default
1.0
tx
tx: number;
Defined in: geom/Matrix.ts:76
The distance by which to translate each point along the x axis.
Default
0.0
ty
ty: number;
Defined in: geom/Matrix.ts:85
The distance by which to translate each point along the y axis.
Default
0.0
Methods
concat()
concat(value: Matrix): Matrix;
Defined in: geom/Matrix.ts:157
Multiplies the current matrix with another matrix.
Parameters
Parameter | Type | Description |
---|---|---|
value | Matrix | The matrix that needs to be multiplied. |
Returns
Matrix
identity()
identity(): Matrix;
Defined in: geom/Matrix.ts:140
Convert to unit matrix. The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0.
Returns
Matrix
invert()
invert(): Matrix;
Defined in: geom/Matrix.ts:195
Convert to inverse matrix.
Returns
Matrix
toString()
toString(): string;
Defined in: geom/Matrix.ts:102
Returns
string
transformPoint()
transformPoint(
x: number,
y: number,
result: object,
delta: boolean): void;
Defined in: geom/Matrix.ts:256
Apply a matrix transformation to a specific point.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
x | number | undefined | X coordinate. |
y | number | undefined | Y coordinate. |
result | { x : number ; y : number ; } | undefined | The point after the transformation is applied. |
result.x | number | undefined | - |
result.y | number | undefined | - |
delta | boolean | false | Whether to ignore tx, ty's conversion to point. |
Returns
void