Interface DOMMatrixReadOnly
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
is2D: boolean;
isIdentity: boolean;
m11: number;
m12: number;
m13: number;
m14: number;
m21: number;
m22: number;
m23: number;
m24: number;
m31: number;
m32: number;
m33: number;
m34: number;
m41: number;
m42: number;
m43: number;
m44: number;
flipX(): DOMMatrix;
flipY(): DOMMatrix;
inverse(): DOMMatrix;
multiply(other?: DOMMatrixInit): DOMMatrix;
rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
rotateAxisAngle(
x?: number,
y?: number,
z?: number,
angle?: number,
): DOMMatrix;
rotateFromVector(x?: number, y?: number): DOMMatrix;
scale(
scaleX?: number,
scaleY?: number,
scaleZ?: number,
originX?: number,
originY?: number,
originZ?: number,
): DOMMatrix;
scale3d(
scale?: number,
originX?: number,
originY?: number,
originZ?: number,
): DOMMatrix;
scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix;
skewX(sx?: number): DOMMatrix;
skewY(sy?: number): DOMMatrix;
toFloat32Array(): Float32Array<ArrayBuffer>;
toFloat64Array(): Float64Array<ArrayBuffer>;
toJSON(): any;
toString(): string;
transformPoint(point?: DOMPointInit): DOMPoint;
translate(tx?: number, ty?: number, tz?: number): DOMMatrix;
}
Hierarchy
- DOMMatrixReadOnly (View Summary)
Properties
Readonlya
Readonlyb
Readonlyc
Readonlyd
Readonlye
Readonlyf
Readonlyis2D
The readonly is2D property of the DOMMatrixReadOnly interface is a Boolean flag that is true when the matrix is 2D.
ReadonlyisIdentity
The readonly isIdentity property of the DOMMatrixReadOnly interface is a Boolean whose value is true if the matrix is the identity matrix.
Readonlym11
Readonlym12
Readonlym13
Readonlym14
Readonlym21
Readonlym22
Readonlym23
Readonlym24
Readonlym31
Readonlym32
Readonlym33
Readonlym34
Readonlym41
Readonlym42
Readonlym43
Readonlym44
Methods
flipX
The
flipX()method of the DOMMatrixReadOnly interface creates a new matrix being the result of the original matrix flipped about the x-axis.Returns DOMMatrix
flipY
The
flipY()method of the DOMMatrixReadOnly interface creates a new matrix being the result of the original matrix flipped about the y-axis.Returns DOMMatrix
inverse
The
inverse()method of the DOMMatrixReadOnly interface creates a new matrix which is the inverse of the original matrix.Returns DOMMatrix
multiply
The
multiply()method of the DOMMatrixReadOnly interface creates and returns a new matrix which is the dot product of the matrix and theotherMatrixparameter.Parameters
Optionalother: DOMMatrixInit
Returns DOMMatrix
rotate
The
rotate()method of the DOMMatrixReadOnly interface returns a new DOMMatrix created by rotating the source matrix around each of its axes by the specified number of degrees.Parameters
OptionalrotX: numberOptionalrotY: numberOptionalrotZ: number
Returns DOMMatrix
rotateAxisAngle
The
rotateAxisAngle()method of the DOMMatrixReadOnly interface returns a new DOMMatrix created by rotating the source matrix by the given vector and angle.Parameters
Optionalx: numberOptionaly: numberOptionalz: numberOptionalangle: number
Returns DOMMatrix
rotateFromVector
The
rotateFromVector()method of the DOMMatrixReadOnly interface is returns a new DOMMatrix created by rotating the source matrix by the angle between the specified vector and(1, 0).Parameters
Optionalx: numberOptionaly: number
Returns DOMMatrix
scale
- scale(
scaleX?: number,
scaleY?: number,
scaleZ?: number,
originX?: number,
originY?: number,
originZ?: number,
): DOMMatrixThe
scale()method of the original matrix with a scale transform applied.Parameters
OptionalscaleX: numberOptionalscaleY: numberOptionalscaleZ: numberOptionaloriginX: numberOptionaloriginY: numberOptionaloriginZ: number
Returns DOMMatrix
scale3d
The
scale3d()method of the DOMMatrixReadOnly interface creates a new matrix which is the result of a 3D scale transform being applied to the matrix.Parameters
Optionalscale: numberOptionaloriginX: numberOptionaloriginY: numberOptionaloriginZ: number
Returns DOMMatrix
scaleNonUniform
skewX
The
skewX()method of the DOMMatrixReadOnly interface returns a new DOMMatrix created by applying the specified skew transformation to the source matrix along its x-axis.Parameters
Optionalsx: number
Returns DOMMatrix
skewY
The
skewY()method of the DOMMatrixReadOnly interface returns a new DOMMatrix created by applying the specified skew transformation to the source matrix along its y-axis.Parameters
Optionalsy: number
Returns DOMMatrix
toFloat32Array
The
toFloat32Array()method of the DOMMatrixReadOnly interface returns a new Float32Array containing all 16 elements (m11,m12,m13,m14,m21,m22,m23,m24,m31,m32,m33,m34,m41,m42,m43,m44) which comprise the matrix.Returns Float32Array<ArrayBuffer>
toFloat64Array
The
toFloat64Array()method of the DOMMatrixReadOnly interface returns a new Float64Array containing all 16 elements (m11,m12,m13,m14,m21,m22,m23,m24,m31,m32,m33,m34,m41,m42,m43,m44) which comprise the matrix.Returns Float64Array<ArrayBuffer>
toJSON
The
toJSON()method of the DOMMatrixReadOnly interface creates and returns a JSON object.Returns any
toString
Returns string
transformPoint
The
transformPointmethod of the You can also create a newDOMPointby applying a matrix to a point with the DOMPointReadOnly.matrixTransform() method.Parameters
Optionalpoint: DOMPointInit
Returns DOMPoint
translate
The
translate()method of the DOMMatrixReadOnly interface creates a new matrix being the result of the original matrix with a translation applied.Parameters
Optionaltx: numberOptionalty: numberOptionaltz: number
Returns DOMMatrix
The
DOMMatrixReadOnlyinterface represents a read-only 4×4 matrix, suitable for 2D and 3D operations.MDN Reference