The DOMMatrix interface represents 4x4 matrices, suitable for 2D and 3D operations.
Documentation DOMMatrix by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
Constructor
Methods
Returns itself, a DOMMatrix, with its new content being the result of the original matrix being inverted. If the matrix cannot be inverted, all its components are set to NaN and is2D() returns false.
Returns itself, a DOMMatrix, with its new content being the result of the original matrix being rotated by the given angle and the give vector.
Returns itself, a DOMMatrix, with its new content being the result of the original matrix being rotated by the angle between the given vector and (1,0), centered on the origin given.
@:value({ originY : 0.0, originX : 0.0 })rotateSelf(angle:Float, originX:Float = 0.0, originY:Float = 0.0):DOMMatrix
Returns itself, a DOMMatrix, with its new content being the result of the original matrix being rotated by the given angle, with the rotation centered on the origin given.
@:value({ originZ : 0.0, originY : 0.0, originX : 0.0 })scale3dSelf(scale:Float, originX:Float = 0.0, originY:Float = 0.0, originZ:Float = 0.0):DOMMatrix
Returns itself, a DOMMatrix, with its new content being the result of the matrix x, y and z dimension being scaled by the given factor, centered on the origin given.
@:value({ originZ : 0.0, originY : 0.0, originX : 0.0, scaleZ : 1.0, scaleY : 1.0 })scaleNonUniformSelf(scaleX:Float, scaleY:Float = 1.0, scaleZ:Float = 1.0, originX:Float = 0.0, originY:Float = 0.0, originZ:Float = 0.0):DOMMatrix
Returns itself, a DOMMatrix, with its new content being the result of the matrix x, y and z dimension being scaled by the given factor for each dimension, centered on the origin given.
@:value({ originY : 0.0, originX : 0.0 })scaleSelf(scale:Float, originX:Float = 0.0, originY:Float = 0.0):DOMMatrix
Returns itself, a DOMMatrix, with its new content being the result of the matrix x and y dimensions being scaled by the given factor, centered on the origin given.
Returns itself, a DOMMatrix, with its new content being the result of the original matrix being skewed along the x-axis by the given factor.
Returns itself, a DOMMatrix, with its new content being the result of the original matrix being skewed along the y-axis by the given factor.
Returns itself, a DOMMatrix, with its new content being the result of the matrix being translated by the given vector.
Inherited Variables
Are double representing each component of a 4x4 matrix needed for 2D rotations and translations. They are aliases for some components of the 4x4 matrix:
2D
3D equivalent
a |
m11 |
b |
m12 |
c |
m21 |
d |
m22 |
e |
m41 |
f |
m42 |
They are read-only, but their counterpart, with the same name, in
DOMMatrix aren't.
Is a Boolean indicating if the matrix contains a 2D matrix and only accept 2D transformations.
Are double representing each component of a 4x4 matrix. They are read-only, but their counterpart, with the same name, in DOMMatrix aren't.
Inherited Methods
Returns a DOMMatrix containing a new matrix being the result of the original matrix being flipped around the x-axis, that is multiplied by the DOMMatrix(-1, 0, 0, 1, 0, 0). The original matrix is not modified.
Returns a DOMMatrix containing a new matrix being the result of the original matrix being flipped around the y-axis, that is multiplied by the DOMMatrix(1, 0, 0, -1, 0, 0). The original matrix is not modified.
Returns a DOMMatrix containing a new matrix being the result of the original matrix being multiplied by the given DOMMatrix. The original matrix is not modified.
@:value({ originY : 0.0, originX : 0.0 })rotate(angle:Float, originX:Float = 0.0, originY:Float = 0.0):DOMMatrix
Returns a DOMMatrix containing a new matrix being the result of the original matrix being rotated by the given angle, with the rotation centered on the origin given. The original matrix is not modified.
Returns a DOMMatrix containing a new matrix being the result of the original matrix being rotated by the given angle and the give vector. The original matrix is not modified.
Returns a DOMMatrix containing a new matrix being the result of the original matrix being rotated by the angle between the given vector and (1,0), centered on the origin given. The original matrix is not modified.
@:value({ originY : 0.0, originX : 0.0 })scale(scale:Float, originX:Float = 0.0, originY:Float = 0.0):DOMMatrix
Returns a DOMMatrix containing a new matrix being the result of the matrix x and y dimensions being scaled by the given factor, centered on the origin given. The original matrix is not modified.
@:value({ originZ : 0.0, originY : 0.0, originX : 0.0 })scale3d(scale:Float, originX:Float = 0.0, originY:Float = 0.0, originZ:Float = 0.0):DOMMatrix
Returns a DOMMatrix containing a new matrix being the result of the matrix x, y and z dimension being scaled by the given factor, centered on the origin given. The original matrix is not modified.
@:value({ originZ : 0.0, originY : 0.0, originX : 0.0, scaleZ : 1.0, scaleY : 1.0 })scaleNonUniform(scaleX:Float, scaleY:Float = 1.0, scaleZ:Float = 1.0, originX:Float = 0.0, originY:Float = 0.0, originZ:Float = 0.0):DOMMatrix
Returns a DOMMatrix containing a new matrix being the result of the matrix x, y and z dimension being scaled by the given factor for each dimension, centered on the origin given. The original matrix is not modified.
Returns a DOMMatrix containing a new matrix being the result of the original matrix being skewed along the x-axis by the given factor. The original matrix is not modified.
Returns a DOMMatrix containing a new matrix being the result of the original matrix being skewed along the y-axis by the given factor. The original matrix is not modified.
Returns a DOMPoint that is the point given in parameter multiplied by the matrix. Bot the original point and the matrix aren't modified.
Returns a DOMMatrix containing a new matrix being the result of the matrix being translated by the given vector. The original matrix is not modified.