TransformationMatrix

A TransformationMatrix is a 2D transformation matrix following the CSS matrix transform format.

Constructor

new TransformationMatrix(a, b, c, d, e, f)

Creates a new TransformationMatrix with the given components.

Parameters:
NameTypeDescription
anumber

The a component of the matrix.

bnumber

The b component of the matrix.

cnumber

The c component of the matrix.

dnumber

The d component of the matrix.

enumber

The e component of the matrix.

fnumber

The f component of the matrix.

Classes

TransformationMatrix

Members

a

The a component of the matrix.

a

The a component of the matrix.

b

The b component of the matrix.

b

The b component of the matrix.

c

The c component of the matrix.

c

The c component of the matrix.

d

The d component of the matrix.

d

The d component of the matrix.

e

The e component of the matrix.

e

The e component of the matrix.

f

The f component of the matrix.

f

The f component of the matrix.

Methods

apply(other)

Applies another TransformationMatrix to this matrix.

Parameters:
NameTypeDescription
otherTransformationMatrix

clone() → {TransformationMatrix}

Clones the TransformationMatrix.

Returns:
Type: 
TransformationMatrix

inverse() → {TransformationMatrix}

Gets the matrix that undoes this TransformationMatrix.

Returns:

The inverse matrix.

Type: 
TransformationMatrix

(static) identity() → {TransformationMatrix}

Returns the identity matrix.

Returns:

The identity matrix.

Type: 
TransformationMatrix

(static) rotate(angle) → {TransformationMatrix}

Gets the matrix that rotates by a given angle in radians.

Parameters:
NameTypeDescription
anglenumber

The angle in radians to rotate by.

Returns:

The rotated matrix.

Type: 
TransformationMatrix

(static) scale(x, y) → {TransformationMatrix}

Gets the matrix that scales by a given x and y value.

Parameters:
NameTypeDescription
xnumber

The x value to scale by.

ynumber

The y value to scale by.

Returns:

The scaled matrix.

Type: 
TransformationMatrix

(static) translate(x, y) → {TransformationMatrix}

Gets the matrix that translates by a given x and y value.

Parameters:
NameTypeDescription
xnumber

The x value to translate by.

ynumber

The y value to translate by.

Returns:

The translated matrix.

Type: 
TransformationMatrix