Class: Matrix2

Matrix2(aopt, bopt, copt, dopt, eopt, fopt)

A class that is used to transform positions through rotation, scaling and translation.

Constructor

new Matrix2(aopt, bopt, copt, dopt, eopt, fopt)

Parameters:
Name Type Attributes Default Description
a number <optional>
1
b number <optional>
0
c number <optional>
0
d number <optional>
1
e number <optional>
0
f number <optional>
0
Source:

Classes

Matrix2

Methods

append(m) → {this}

Multiplies with another matrix, A * B = C, where A is this matrix
Parameters:
Name Type Description
m Matrix2
Source:
Returns:
Type
this

clone()

Creates a new matrix,fills its values with this ones and returns the former.
Source:
Returns:
Matrix2

copy(m)

Copies a matrix into this matrix.
Parameters:
Name Type Description
m Matrix2
Source:
Returns:
this

equals(matrix)

Deeply checks if a matrix is equal to another.
Parameters:
Name Type Description
matrix Matrix2
Source:
Returns:
boolean

identity()

Makes a matrix to be an identity matrix.
Source:
Returns:
this

invert()

Inverts the matrix.
Source:
Returns:
this

prepend(m)

Multiplies with another matrix, A * B = C, where B is this matrix
Parameters:
Name Type Description
m Matrix2
Source:
Returns:
this

rotate(radians)

Rotates the matrix by the given angle.
Parameters:
Name Type Description
radians number
Source:
Returns:
this

scale(x, y)

Scales a matrix by a given amount.
Parameters:
Name Type Description
x number
y number
Source:
Returns:
this

setFromTransform(x, y, scaleX, scaleY, rotation)

Parameters:
Name Type Description
x number
y number
scaleX number
scaleY number
rotation number
Source:
Returns:
this

transform(v)

Transforms the given vector.
Parameters:
Name Type Description
v Vector2
Source:

translate(x, y)

Translates a matrix by a given amount.
Parameters:
Name Type Description
x number
y number
Source:
Returns:
this