mat2
library
Functions
add (List <double > out , List <double > a , List <double > b )
→ List <double >
Adds two mat2's
adjoint (List <double > out , List <double > a )
→ dynamic
Calculates the adjugate of a mat2
clone (List <double > a )
→ List <double >
Creates a new mat2 initialized with values from an existing matrix
copy (List <double > out , List <double > a )
→ List <double >
Copy the values from one mat2 to another
create ()
→ List <double >
2x2 Matrix
@module mat2
Creates a new identity mat2
determinant (List <double > a )
→ double
Calculates the determinant of a mat2
equals (List <double > a , List <double > b )
→ bool
Returns whether or not the matrices have approximately the same elements in the same position.
exactEquals (List <double > a , List <double > b )
→ bool
Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
frob (List <double > a )
→ double
Returns Frobenius norm of a mat2
fromRotation (List <double > out , double rad )
→ dynamic
Creates a matrix from a given angle
This is equivalent to (but much faster than):
fromScaling (List <double > out , List <double > v )
→ dynamic
Creates a matrix from a vector scaling
This is equivalent to (but much faster than):
fromValues (double m00 , double m01 , double m10 , double m11 )
→ List <double >
Create a new mat2 with the given values
identity (List <double > out )
→ List <double >
Set a mat2 to the identity matrix
invert (List <double > out , List <double > a )
→ List <double > ?
Inverts a mat2
LDU (List <double > L , List <double > D , List <double > U , List <double > a )
→ List <List <double > >
Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix
@param {ReadonlyMat2} L the lower triangular matrix
@param {ReadonlyMat2} D the diagonal matrix
@param {ReadonlyMat2} U the upper triangular matrix
@param {ReadonlyMat2} a the input matrix to factorize
multiply (List <double > out , List <double > a , List <double > b )
→ List <double >
Multiplies two mat2's
multiplyScalar (List <double > out , List <double > a , double b )
→ List <double >
Multiply each element of the matrix by a scalar.
multiplyScalarAndAdd (List <double > out , List <double > a , List <double > b , double scale )
→ List <double >
Adds two mat2's after multiplying each element of the second operand by a scalar value.
rotate (List <double > out , List <double > a , double rad )
→ List <double >
Rotates a mat2 by the given angle
scale (List <double > out , List <double > a , List <double > v )
→ dynamic
Scales the mat2 by the dimensions in the given vec2
set (List <double > out , double m00 , double m01 , double m10 , double m11 )
→ List <double >
Set the components of a mat2 to the given values
str (List <double > a )
→ String
Returns a string representation of a mat2
subtract (List <double > out , List <double > a , List <double > b )
→ List <double >
Subtracts matrix b from matrix a
transpose (List <double > out , List <double > a )
→ List <double >
Transpose the values of a mat2