JavaScripture
Contribute via GitHub Feedback

DOMMatrix : DOMMatrixReadOnly

Constructors

new DOMMatrix() : DOMMatrix

Constructs new 2D identity matrix.

Example:

Run

Results:

 

new DOMMatrix(cssTransform : String) : DOMMatrix

Constructs a new matrix using the specified cssTransform. The syntax for this string is the same as for the css transform property.

Example:

Run

Results:

 

new DOMMatrix(values : Iterator<Number>) : DOMMatrix

values must have either 6 or 16 elements in it.

If 6 elements are specified (a, b, ..., f), the matrix will be a 2D matrix constructed like:

ace
bdf
001

Example:

Run

Results:

 

If 16 elements are specified (m11, m12, m13, m14, m21, m22, ..., m44), the matrix will be a 3D matrix constructed like:

m11m12m13m14
m21m22m23m24
m31m32m33m34
m41m42m43m44

Example:

Run

Results:

 

Instance Properties

a : Number

Returns the a element of the matrix. This is the same as the m11 element.

Example:

Run

Results:

 

b : Number

Returns the b element of the matrix. This is the same as the m12 element.

Example:

Run

Results:

 

c : Number

Returns the c element of the matrix. This is the same as the m21 element.

Example:

Run

Results:

 

d : Number

Returns the d element of the matrix. This is the same as the m22 element.

Example:

Run

Results:

 

e : Number

Returns the e element of the matrix. This is the same as the m41 element.

Example:

Run

Results:

 

f : Number

Returns the f element of the matrix. This is the same as the m42 element.

Example:

Run

Results:

 

m11 : Number

Returns the m11 element of the matrix. This is the same as the a element.

Example:

Run

Results:

 

m12 : Number

Returns the m12 element of the matrix. This is the same as the b element.

Example:

Run

Results:

 

m13 : Number

Returns the m13 element of the matrix.

Example:

Run

Results:

 

m14 : Number

Returns the m14 element of the matrix.

Example:

Run

Results:

 

m21 : Number

Returns the m21 element of the matrix. This is the same as the c element.

Example:

Run

Results:

 

m22 : Number

Returns the m22 element of the matrix. This is the same as the d element.

Example:

Run

Results:

 

m23 : Number

Returns the m23 element of the matrix.

Example:

Run

Results:

 

m24 : Number

Returns the m24 element of the matrix.

Example:

Run

Results:

 

m31 : Number

Returns the m31 element of the matrix.

Example:

Run

Results:

 

m32 : Number

Returns the m32 element of the matrix.

Example:

Run

Results:

 

m33 : Number

Returns the m33 element of the matrix.

Example:

Run

Results:

 

m34 : Number

Returns the m14 element of the matrix.

Example:

Run

Results:

 

m41 : Number

Returns the m41 element of the matrix. This is the same as the e element.

Example:

Run

Results:

 

m42 : Number

Returns the m42 element of the matrix. This is the same as the f element.

Example:

Run

Results:

 

m43 : Number

Returns the m43 element of the matrix.

Example:

Run

Results:

 

m44 : Number

Returns the m44 element of the matrix.

Example:

Run

Results:

 

Instance Methods

invertSelf() : DOMMatrix

multiplySelf 2 variants
multiplySelf([matrix : Object]) : DOMMatrix

Same as multiyply(fromMatrix(matrix)).

multiplySelf([matrix : DOMMatrixReadOnly]) : DOMMatrix

preMultiplySelf 2 variants
preMultiplySelf([matrix : Object]) : DOMMatrix

Same as preMultiyply(fromMatrix(matrix)).

preMultiplySelf([matrix : DOMMatrixReadOnly]) : DOMMatrix

rotateAxisAngleSelf([x = 0 : Number, [y = 0 : Number, [z = 0 : Number, [degrees = 0 : Number]]]]) : DOMMatrix

rotateFromVectorSelf([x = 0 : Number, [y = 0 : Number]]) : DOMMatrix

Rotates this by the angle between the x axis and the vector from the origin to the specified point (x, y). Same as this.rotateSelf(Math.atan2(y, x) * 180 / Math.PI). Return this.

Example:

Run

Results:

 

rotateSelf 2 variants
rotateSelf([degreesX = 0 : Number, [degreesY = 0 : Number, [degreesZ = 0 : Number]]]) : DOMMatrix

Applies the specfied rotation to this. Returns this.

rotateSelf(degreesZ = 0 : Number) : DOMMatrix

Applies the specfied rotation to this. Returns this.

scale3DSelf([scale = 1 : Number, [originX = 0 : Number, [originY = 0 : Number, [originZ = 0 : Number]]]]) : DOMMatrix

Applies the specfied scale to this. Returns this.

scaleSelf([scaleX = 1 : Number, [scaleY = scaleX : Number, [scaleZ = 1 : Number, [originX = 0 : Number, [originY = 0 : Number, [originZ = 0 : Number]]]]]]) : DOMMatrix

Applies the specfied scale to this. Returns this.

setValue(cssTransform : String) : DOMMatrix

skewXSelf([degrees = 0 : Number]) : DOMMatrix

Example:

Run

Results:

 

skewY([degrees = 0 : Number]) : DOMMatrix

Example:

Run

Results:

 

translateSelf([x : Number, [y : Number, [z : Number]]]) : DOMMatrix

Applies the specfied translation to this. Returns this.

Example:

Run

Results:

 

DOMMatrix Methods

fromFloat32Array(values : Float32Array) : DOMMatrix

fromFloat64Array(values : Float64Array) : DOMMatrix

fromMatrix 2 variants
fromMatrix([matrix : DOMMatrixReadOnly]) : DOMMatrix

fromMatrix(init : Object) : DOMMatrixReadOnly