MatrixUtil Class
yui3/src/matrix/js/MatrixUtil.js:1
Matrix utilities.
Index
Methods
Properties
Methods
_round
()
private
Rounds values
angle2rad
-
val
Converts an angle to a radian
Parameters:
-
val
ObjecxtValue to be converted to radian.
Returns:
Number
compareTransformSequence
-
list1
-
list2
Compares to arrays or transform functions to ensure both contain the same functions in the same order.
Parameters:
-
list1
ArrayArray to compare
-
list2
ArrayArray to compare
Returns:
Boolean
decompose
-
matrix
Breaks up a 2d transform matrix into a series of transform operations.
Parameters:
-
matrix
ArrayA 3x3 multidimensional array
Returns:
Array
deg2rad
-
deg
Converts a degree value to a radian.
Parameters:
-
deg
NumberDegree value to be converted to radian.
Returns:
Number
getDeterminant
-
matrix
Returns the determinant of a given matrix.
/
| 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] |
| matrix[0][3] matrix[1][3] matrix[2][3] |
\ /
Parameters:
-
matrix
ArrayAn nxn matrix represented an array of vector (column) arrays. Each vector array has index for each row.
Returns:
Number
getMinors
-
matrix
-
columnIndex
-
rowIndex
Returns a matrix of minors based on a matrix, column index and row index.
Parameters:
Returns:
Array
getnxn
()
Converts a transform object to an array of column vectors.
/
| 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 transform string and returns an array of transform arrays.
Parameters:
-
val
StringA transform string
Returns:
Array
getTransformFunctionArray
()
Returns an array of transform arrays representing transform functions and arguments.
Returns:
Array
inverse
-
Array
Returns the inverse of a matrix
Parameters:
-
Array
Objectmatrix An array representing an nxn matrix
Returns:
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] |
| matrix[0][3] matrix[1][3] matrix[2][3] |
\ /
rad2deg
-
rad
Converts a radian value to a degree.
Parameters:
-
rad
NumberRadian value to be converted.
Returns:
Number
scalarMultiply
-
matrix
-
multiplier
Multiplies a matrix by a numeric value.
Parameters:
-
matrix
ArrayThe matrix to be altered.
-
multiplier
NumberThe number to multiply against the matrix.
Returns:
Array
sign
-
val
Returns the sign of value
Parameters:
-
val
Numbervalue to be interpreted
Returns:
Number
transpose
-
matrix
Returns the transpose for an nxn matrix.
Parameters:
-
matrix
ObjectAn nxn matrix represented by an array of vector arrays.
Returns:
Array
vectorMatrixProduct
-
vector
-
matrix
Multiplies a vector and a matrix
Parameters:
-
vector
ArrayArray representing a column vector
-
matrix
ArrayArray representing an nxn matrix
Returns:
Array
Properties
_rounder
Unknown
private
Used as value for the _rounding method.
transformMethods
Object
Mapping of possible transform method names.