new Matrix
The Matrix class.
Parameters:
| Name | Type | Description |
|---|---|---|
a |
number | array | Horizontal/x scale or array of a, b, c, d, tx, ty |
b |
number | Vertical/y skew |
c |
number | Horizontal/x skew |
d |
number | Vertical/y scale |
tx |
number | Horizontal/x translation |
ty |
number | Vertical/y translation |
Methods
-
clone
-
Returns a clone of the matrix
Returns:
- Type
- Matrix
-
concat
-
Concatenates a matrix with the current matrix. Effectively combines the geometric effects of the two matrices.
Parameters:
Name Type Description mMatrix Returns:
The instance- Type
- Matrix
-
createBox
-
Applies parameters for scaling, rotation, and translation. Using the createBox() method lets you obtain the same matrix as you would if you applied the identity(), rotate(), scale(), and translate() methods in succession.
Parameters:
Name Type Description scaleXnumber The horizontal scale scaleYnumber The vertical scale rotationnumber The rotation in radians txnumber The horizontal translation txnumber The vertical translation Returns:
The instance- Type
- Matrix
-
deltaTransformPoint
-
Given a point in the pretransform coordinate space, returns the coordinates of that point after the transformation occurs. Unlike the standard transformation applied using the transformPoint() method, the deltaTransformPoint() method's transformation does not consider the translation parameters tx and ty.
Parameters:
Name Type Description pointPoint The point to transform Returns:
- Type
- Point
-
identify
-
Sets each matrix property to a value that causes a null transformation. An object transformed by applying an identity matrix will be identical to the original.
Returns:
The instance- Type
- Matrix
-
invert
-
Performs the opposite transformation of the original matrix. You can apply an inverted matrix to an object to undo the transformation performed when applying the original matrix.
Returns:
The instance- Type
- Matrix
-
rotate
-
Applies a rotation transformation to the Matrix object.
Parameters:
Name Type Description anglenumber The rotation angle in radians. Returns:
The instance- Type
- Matrix
-
scale
-
Applies a scaling transformation to the matrix. The x axis is multiplied by sx, and the y axis it is multiplied by sy.
Parameters:
Name Type Description sxnumber Multiplier for the x axis synumber Multiplier for the y axis Returns:
The instance- Type
- Matrix
-
transformPoint
-
Returns the result of applying the geometric transformation represented by the Matrix object to the specified point.
Parameters:
Name Type Description pointPoint The point to transform Returns:
- Type
- Point
-
translate
-
Translates the matrix along the x and y axes.
Parameters:
Name Type Description xnumber The translation along the x axis ynumber The translation along the y axis Returns:
The instance.- Type
- Matrix