New to Kendo UI for AngularStart a free 30-day trial

Matrix

Class

Represents a 3x3 transformation matrix in the following form:

a c e ( b d f ) 0 0 1

Definition

Package:@progress/kendo-drawing

Methods

Creates a new instance with the same element values.

Returns:

Matrix

  • A new Matrix instance with the same element values.

Compares this matrix with another instance.

Parameters:otherMatrix

The matrix instance to compare with.

Returns:

boolean

true if the matrix elements match. Otherwise, returns false.

Multiplies the matrix by another one and returns the result as a new instance. The current instance elements are not altered.

Parameters:matrixMatrix

The matrix to multiply by.

Returns:

Matrix

  • The result of the multiplication.

Creates a transformation matrix for rotation with the specified parameters.

Parameters:anglenumber

The angle of rotation in decimal degrees. Measured in a clockwise direction with 0 (zero) pointing "right". Negative values or values greater than 360 are normalized.

xnumber

The center of rotation on the X axis.

ynumber

The center of rotation on the Y axis.

Returns:

Matrix

  • The transformation matrix for the specified rotation.

Rounds the matrix elements to the specified number of fractional digits.

Parameters:digitsnumber

The number of fractional digits.

Returns:

Matrix

  • The current matrix instance.

Creates a transformation matrix for the scale with the specified parameters.

Parameters:scaleXnumber

The scale factor on the X axis.

scaleYnumber

The scale factor on the Y axis.

Returns:

Matrix

  • The transformation matrix for the specified scale.

Returns the matrix elements as an [a, b, c, d, e, f] array.

Parameters:digits?number

The number of fractional digits.

Returns:

number[]

  • An array representation of the matrix.

Formats the matrix elements as a string.

Parameters:digits?number

The number of fractional digits.

separator?string

The separator to place between elements.

Returns:

string

  • A string representation of the matrix. For example, "1, 0, 0, 1, 0, 0".

Creates a transformation matrix for the translation with the specified parameters.

Parameters:xnumber

The distance to translate along the X axis.

ynumber

The distance to translate along the Y axis.

Returns:

Matrix

  • The transformation matrix for the specified translation.

Returns the unit (identity) transformation matrix.

Returns:

Matrix

  • The unit (identity) matrix.

Properties

a

number

The a (1, 1) member of the matrix.

b

number

The b (2, 1) member of the matrix.

c

number

The c (1, 2) member of the matrix.

d

number

The d (2, 2) member of the matrix.

e

number

The e (1, 3) member of the matrix.

f

number

The f (2, 3) member of the matrix.