Matrix

F2.G.Matrix

Matrix provides operations for 2x3 matrix.

Methods

multiply(m1, m2)

Multiply the two matrix.

Parameters:

Returns: Type: Array

scale(out, m, v)

Scale operation.

Parameters:

Returns: Type: Array

rotate(out, m, radian)

Rotation operation.

Parameters:

Returns: Type: Array

translate(out, m, v)

Translation operation.

Parameters:

Returns: Type: Array

transform(m, actions)

Perform translation, rotation and scale operations. All operations are configured and stored in actions, the supported operations in actions attribute are: 't' (translate), 's' (scale), 'r' (rotate). Operations can be combined in any combination. For example:

[
  [ 't', x, y ], // t for translate, x for offset on x-axis direction, y for offset in y-axis direction
  [ 's', sx, sy ], // s for scale, sx for scale on x-axis direction, sy for scale on y-axis direction
  [ 'r', radian] // r for rotate,radian for the radians of the rotation
]

Parameters:

Returns: Type: Array

Last updated