Matrix Class
+ + + + +Matrix is a class that allows for the manipulation of a transform matrix. +This class is a work in progress.
+Constructor
+Matrix
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
- Index + + +
- Methods + + +
- Properties + + + +
Item Index
+ + +Methods
+ +-
+
+
- + _round + + + + + +
- + applyCSSText + + + + + +
- + decompose + + + + + +
- + deg2rad + + + + + +
- + getContentRect + + + + + +
- + getDeterminant + + + + + +
- + getMatrixArray + + + + + +
- + getTransformArray + + + + + +
- + identity + + + + + +
- + init + + + + + +
- + inverse + + + + + +
- + multiple + + + + + +
- + rad2deg + + + + + +
- + rotate + + + + + +
- + scale + + + + + +
- + skew + + + + + +
- + skewX + + + + + +
- + skewY + + + + + +
- + toCSSText + + + + + +
- + toFilterText + + + + + +
- + translate + + + + + +
- + translateX + + + + + +
- + translateY + + + + + +
- + transpose + + + + + +
Methods
+ + +_round
+
+
+ ()
+
+
+
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+
+
+
+
+ Rounds values
+applyCSSText
+
+
+ -
+
+
-
+
+
val+ +
+
+
Parses a string and updates the matrix.
+Parameters:
+ +-
+
+
-
+
+
val+ String + + + + +++ + +A css transform string
+
+
+
decompose
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an array of transform commands that represent the matrix.
+Returns:
+ +deg2rad
+
+
+ -
+
+
-
+
+
deg+ +
+
+
Converts a degree value to a radian.
+Parameters:
+ +-
+
+
-
+
+
deg+ Number + + + + +++ + +Degree value to be converted to radian.
+
+
+
Returns:
+ +getContentRect
+
+
+ -
+
+
-
+
+
width+ +
+
+ -
+
+
height+ +
+
+ -
+
+
x+ +
+
+ -
+
+
y+ +
+
+
Returns the left, top, right and bottom coordinates for a transformed +item.
+Parameters:
+ + +Returns:
+ +getDeterminant
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns the determinant of the matrix.
+Returns:
+ +getMatrixArray
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns a 3x3 Matrix array
+ +/ \ +| matrix[0][0] matrix[1][0] matrix[2][0] | +| matrix[0][1] matrix[1][1] matrix[2][1] | +| matrix[0][2] matrix[1][2] matrix[2][2] | +\ /
+Returns:
+ +getTransformArray
+
+
+ -
+
+
-
+
+
val+ +
+
+
Parses a string and returns an array of transform arrays.
+Parameters:
+ +-
+
+
-
+
+
val+ String + + + + +++ + +A css transform string
+
+
+
Returns:
+ +identity
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns an identity matrix.
+Returns:
+ +init
+
+
+ -
+
+
-
+
+
config+ +
+
+
Initializes a matrix.
+Parameters:
+ +-
+
+
-
+
+
config+ Object + + + + +++ + +Specified key value pairs for matrix properties. If a property is not explicitly defined in the config argument, +the default value will be used.
+
+
+
inverse
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns the inverse (in array form) of the matrix.
+Returns:
+ +multiple
+
+
+ -
+
+
-
+
+
a+ +
+
+ -
+
+
b+ +
+
+ -
+
+
c+ +
+
+ -
+
+
d+ +
+
+ -
+
+
dx+ +
+
+ -
+
+
dy+ +
+
+
Updates the matrix.
+rad2deg
+
+
+ -
+
+
-
+
+
rad+ +
+
+
Converts a radian value to a degree.
+Parameters:
+ +-
+
+
-
+
+
rad+ Number + + + + +++ + +Radian value to be converted.
+
+
+
Returns:
+ +rotate
+
+
+ -
+
+
-
+
+
deg+ +
+
+
Applies a rotate transform.
+Parameters:
+ +-
+
+
-
+
+
deg+ Number + + + + +++ + +The degree of the rotation.
+
+
+
scale
+
+
+ -
+
+
-
+
+
val+ +
+
+
Applies a scale transform
+Parameters:
+ +-
+
+
-
+
+
val+ Number + + + + ++ ++ + +
+
+
skew
+
+
+ -
+
+
-
+
+
x+ +
+
+ -
+
+
y+ +
+
+
Applies a skew transformation.
+skewX
+
+
+ -
+
+
-
+
+
x+ +
+
+
Applies a skew to the x-coordinate
+Parameters:
+ +-
+
+
-
+
+
x+ Number + + + + +++ + +x-coordinate
+
+
+
skewY
+
+
+ -
+
+
-
+
+
y+ +
+
+
Applies a skew to the y-coordinate
+Parameters:
+ +-
+
+
-
+
+
y+ Number + + + + +++ + +y-coordinate
+
+
+
toCSSText
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns a string of text that can be used to populate a the css transform property of an element.
+Returns:
+ +toFilterText
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns a string that can be used to populate the css filter property of an element.
+Returns:
+ +translate
+
+
+ -
+
+
-
+
+
x+ +
+
+ -
+
+
y+ +
+
+
Applies translate transformation.
+translateX
+
+
+ -
+
+
-
+
+
x+ +
+
+
Applies a translate to the x-coordinate
+Parameters:
+ +-
+
+
-
+
+
x+ Number + + + + +++ + +x-coordinate
+
+
+
translateY
+
+
+ -
+
+
-
+
+
y+ +
+
+
Applies a translate to the y-coordinate
+Parameters:
+ +-
+
+
-
+
+
y+ Number + + + + +++ + +y-coordinate
+
+
+
transpose
+
+
+ ()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns the transpose of the matrix
+Returns:
+ +Properties
+ + +_defaults
+ Unknown
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+ Default values for the matrix
+_rounder
+ Unknown
+
+
+
+
+ private
+
+
+
+
+
+
+
+
+ Used as value for the _rounding method.
+