DOMMatrixReadOnly.flipX()
-
Returns a new DOMMatrix
created by flipping the source matrix around its X-axis. This is equivalent to multiplying the matrix by DOMMatrix(-1, 0, 0, 1, 0, 0)
. The original matrix is not modified.
DOMMatrixReadOnly.flipY()
-
Returns a new DOMMatrix
created by flipping the source matrix around its Y-axis. This is equivalent to multiplying the matrix by DOMMatrix(1, 0, 0, -1, 0, 0)
. The original matrix is not modified.
DOMMatrixReadOnly.inverse()
-
Returns a new DOMMatrix
created by inverting the source matrix. If the matrix cannot be inverted, the new matrix's components are all set to NaN
and its is2D
property is set to false
. The original matrix is not altered.
DOMMatrixReadOnly.multiply()
-
Returns a new DOMMatrix
created by computing the dot product of the source matrix and the specified matrix: A⋅B
. If no matrix is specified as the multiplier, the matrix is multiplied by a matrix in which every element is 0
except the bottom-right corner and the element immediately above and to its left: m33
and m34
. These have the default value of 1
. The original matrix is not modified.
DOMMatrixReadOnly.rotateAxisAngle()
-
Returns a new DOMMatrix
created by rotating the source matrix by the given angle around the specified vector. The original matrix is not modified.
DOMMatrixReadOnly.rotate()
-
Returns a new DOMMatrix
created by rotating the source matrix around each of its axes by the specified number of degrees. The original matrix is not altered.
DOMMatrixReadOnly.rotateFromVector()
-
Returns a new DOMMatrix
created by rotating the source matrix by the angle between the specified vector and (1, 0)
. The original matrix is not modified.
DOMMatrixReadOnly.scale()
-
Returns a new DOMMatrix
created by scaling the source matrix by the amount specified for each axis, centered on the given origin. By default, the X and Z axes are scaled by 1
and the Y axis has no default scaling value. The default origin is (0, 0, 0)
. The original matrix is not modified.
DOMMatrixReadOnly.scale3d()
-
Returns a new DOMMatrix
created by scaling the source 3D matrix by the given factor along all its axes, centered on the specified origin point. The default origin is (0, 0, 0)
. The original matrix is not modified.
-
DOMMatrixReadOnly.scaleNonUniform()
Deprecated
-
Returns a new DOMMatrix
created by applying the specified scaling on the X, Y, and Z axes, centered at the given origin. By default, the Y and Z axes' scaling factors are both 1
, but the scaling factor for X must be specified. The default origin is (0, 0, 0)
. The original matrix is not changed.
DOMMatrixReadOnly.skewX()
-
Returns a new DOMMatrix
created by applying the specified skew transformation to the source matrix along its X-axis. The original matrix is not modified.
DOMMatrixReadOnly.skewY()
-
Returns a new DOMMatrix
created by applying the specified skew transformation to the source matrix along its Y-axis. The original matrix is not modified.
DOMMatrixReadOnly.toFloat32Array()
-
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. The elements are stored into the array as single-precision floating-point numbers in column-major (colexographical access, or "colex") order. (In other words, down the first column from top to bottom, then the second column, and so forth.)
DOMMatrixReadOnly.toFloat64Array()
-
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. The elements are stored into the array as double-precision floating-point numbers in column-major (colexographical access, or "colex") order. (In other words, down the first column from top to bottom, then the second column, and so forth.)
DOMMatrixReadOnly.toJSON()
-
Returns a JSON representation of the DOMMatrixReadOnly
object.
DOMMatrixReadOnly.toString()
-
Creates and returns a string object which contains a string representation of the matrix in CSS matrix syntax, using the appropriate CSS matrix notation. See the matrix()
CSS function for details on this syntax.
For a 2D matrix, the elements a
through f
are listed, for a total of six values and the form matrix(a, b, c, d, e, f)
.
For a 3D matrix, the returned string contains all 16 elements and takes the form matrix3d(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44)
. See the CSS matrix3d()
function for details on the 3D notation's syntax.
Throws an InvalidStateError
exception if any of the elements in the matrix are non-finite (even if, in the case of a 2D matrix, the non-finite values are in elements not used by the 2D matrix representation).
DOMMatrixReadOnly.transformPoint()
-
Transforms the specified point using the matrix, returning a new DOMPoint
object containing the transformed point. Neither the matrix nor the original point are altered.
DOMMatrixReadOnly.translate()
-
Returns a new DOMMatrix
containing a matrix calculated by translating the source matrix using the specified vector. By default, the vector is (0, 0, 0)
. The original matrix is not changed.