Matrix
declare class Matrix {}
Matrix math utilities
Instance Method
constructor
Signature
declare class Matrix {
constructor();
}
Description
Create a new matrix instance.
reset
Signature
declare class Matrix {
reset(): void
}
Description
Resets the this to the identity matrix.
setTranslate
Signature
declare class Matrix {
setTranslate(dx: number, dy: number): void
}
Description
Set the matrix to translate by (dx, dy).
setScale
Signature
declare class Matrix {
setScale(sx: number, sy: number): void
}
Description
Set the matrix to scale by sx and sy.
setScale
Signature
declare class Matrix {
setScale(sx: number, sy: number, px: number, py: number): void
}
Description
Set the matrix to scale by sx and sy, with a pivot point at (px, py).
setRotate
Signature
declare class Matrix {
setRotate(degrees: number): void
}
Description
Set the matrix to rotate about (0,0) by the specified number of degrees.
setRotate
Signature
declare class Matrix {
setRotate(degrees: number, px: number, py: number): void
}
Description
Set the matrix to rotate by the specified number of degrees, with a pivot point at (px, py).
setSinCos
Signature
declare class Matrix {
setSinCos(sinValue: number, cosValue: number): void
}
Description
Set the matrix to rotate by the specified sine and cosine values.
setSinCos
Signature
declare class Matrix {
setSinCos(sinValue: number, cosValue: number, px: number, py: number): void
}
Description
Set the matrix to rotate by the specified sine and cosine values, with a pivot point at (px, py).
setSkew
Signature
declare class Matrix {
setSkew(kx: number, ky: number): void
}
Description
Set the matrix to skew by sx and sy.
setSkew
Signature
declare class Matrix {
setSkew(kx: number, ky: number, px: number, py: number): void
}
Description
Set the matrix to skew by sx and sy, with a pivot point at (px, py).
setConcat
Signature
declare class Matrix {
setConcat(a: Matrix, b: Matrix): void
}
Description
Set the matrix to the concatenation of the two specified matrices and return true.
preTranslate
Signature
declare class Matrix {
preTranslate(dx: number, dy: number): void
}
Description
Preconcats the matrix with the specified translation.
preScale
Signature
declare class Matrix {
preScale(sx: number, sy: number): void;
preScale(sx: number, sy: number, px: number, py: number): void
}
Description
Preconcats the matrix with the specified scale.
preRotate
Signature
declare class Matrix {
preRotate(degrees: number): void;
preRotate(degrees: number, px: number, py: number): void;
}
Description
Preconcats the matrix with the specified rotation.
preSkew
Signature
declare class Matrix {
preSkew(kx: number, ky: number): void
preSkew(kx: number, ky: number, px: number, py: number): void
}
Description
Preconcats the matrix with the specified skew.
preConcat
Signature
declare class Matrix {
preConcat(other: Matrix): number
}
Description
Preconcats the matrix with the specified matrix.
postTranslate
Signature
declare class Matrix {
postTranslate(dx: number, dy: number): void
}
Description
Postconcats the matrix with the specified translation.
postScale
Signature
declare class Matrix {
postScale(sx: number, sy: number): void;
postScale(sx: number, sy: number, px: number, py: number): void;
}
Description
Postconcats the matrix with the specified scale.
postRotate
Signature
declare class Matrix {
postRotate(degrees: number): void
postRotate(degrees: number, px: number, py: number): void
}
Description
Postconcats the matrix with the specified rotation.
postSkew
Signature
declare class Matrix {
postSkew(kx: number, ky: number): void
postSkew(kx: number, ky: number, px: number, py: number): void
}
Description
Postconcats the matrix with the specified skew.
postConcat
Signature
declare class Matrix {
postConcat(other: Matrix): number
}
Description
Postconcats the matrix with the specified matrix.
invert
Signature
declare class Matrix {
invert(inverse: Matrix): void
}
Description
If this matrix can be inverted, return true and if inverse is not null, set inverse to be the inverse of this matrix.
mapPoints
Signature
declare class Matrix {
mapPoints(pts: number[][]): void
}
Description
Apply this matrix to the array of 2D points, and write the transformed points back into the array.
mapPoints
Signature
declare class Matrix {
mapPoints(dst: number[][], src: number[][]): void
mapPoints(dst: number[][], dstIndex: number, src: number[][], srcIndex: number, pointCount: number): void
}
Description
Apply this matrix to the array of 2D points specified by src, and write the transformed points into the array of points specified by dst.
mapVectors
Signature
declare class Matrix {
mapVectors(vecs: number[][]): void
}
Description
Apply this matrix to the array of 2D vectors, and write the transformed vectors back into the array.
mapVectors
Signature
declare class Matrix {
mapVectors(dst: number[][], src: number[][]): void;
mapVectors(dst: number[][], dstIndex: number, src: number[][], srcIndex: number, vectorCount: number): void;
}
Description
Apply this matrix to the array of 2D vectors specified by src, and write the transformed vectors into the array of vectors specified by dst.
mapRect
Signature
declare class Matrix {
mapRect(rect: Rect): void
}
Description
Apply this matrix to the rectangle, and write the transformed rectangle back into it.
mapRect
Signature
declare class Matrix {
mapRect(dst: Rect, src: Rect): void
}
Description
Apply this matrix to the src rectangle, and write the transformed rectangle into dst.
mapRadius
Signature
declare class Matrix {
mapRadius(radius: number): number
}
Description
Return the mean radius of a circle after it has been mapped by this matrix.
getValues
Signature
declare class Matrix {
getValues(accept: number[]): number[]
}
Description
Copy 9 values from the matrix into the array.
setValues
Signature
declare class Matrix {
setValues(values: number[]): void
}
Description
Copy 9 values from the array into the matrix.
setRectToRect
Signature
declare class Matrix {
setRectToRect(src: Rect, dst: Rect, stf: Matrix.ScaleToFit): boolean
}
Description
Set the matrix to the scale and translate values that map the source rectangle to the destination rectangle, returning true if the the result can be represented.
setPolyToPoly
Signature
declare class Matrix {
setPolyToPoly(src: number[][], srcIndex: number, dst: number[][], dstIndex: number, pointCount: number): boolean
}
Description
Set the matrix such that the specified src points would map to the specified dst points.
equals
Signature
declare class Matrix {
equals(target: Matrix): boolean
}
Description
Returns true iff obj is a Matrix and its values equal our values.