Matrix Class
yui3/src/matrix/js/Matrix.js:1
Matrix is a class that allows for the manipulation of a transform matrix. This class is a work in progress.
Constructor
Matrix
()
Index
Methods
Methods
_round
()
private
Rounds values
applyCSSText
-
val
Parses a string and updates the matrix.
Parameters:
-
val
StringA css transform string
decompose
()
Returns an array of transform commands that represent the matrix.
Returns:
Array
deg2rad
-
deg
Converts a degree value to a radian.
Parameters:
-
deg
NumberDegree value to be converted to radian.
Returns:
Number
getContentRect
-
width
-
height
-
x
-
y
Returns the left, top, right and bottom coordinates for a transformed item.
Parameters:
Returns:
Object
getDeterminant
()
Returns the determinant of the matrix.
Returns:
Number
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:
Array
getTransformArray
-
val
Parses a string and returns an array of transform arrays.
Parameters:
-
val
StringA css transform string
Returns:
Array
identity
()
Returns an identity matrix.
Returns:
Object
init
-
config
Initializes a matrix.
Parameters:
-
config
ObjectSpecified 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:
Array
multiple
-
a
-
b
-
c
-
d
-
dx
-
dy
Updates the matrix.
rad2deg
-
rad
Converts a radian value to a degree.
Parameters:
-
rad
NumberRadian value to be converted.
Returns:
Number
skew
-
x
-
y
Applies a skew transformation.
toCSSText
()
Returns a string of text that can be used to populate a the css transform property of an element.
Returns:
String
toFilterText
()
Returns a string that can be used to populate the css filter property of an element.
Returns:
String
translate
-
x
-
y
Applies translate transformation.
transpose
()
Returns the transpose of the matrix
Returns:
Array
Properties
_defaults
Unknown
private
Default values for the matrix
_rounder
Unknown
private
Used as value for the _rounding method.