# mat2 library Null safety

## Constants

mul → const List<double> Function( out, a, b)
`multiply`
sub → const List<double> Function( out, a, b)
`subtract`

## Functions

Calculates the adjugate of a mat2
clone( a) List<double>
Creates a new mat2 initialized with values from an existing matrix
copy( out, a) List<double>
Copy the values from one mat2 to another
create() List<double>
2x2 Matrix @module mat2 Creates a new identity mat2
determinant( a)
Calculates the determinant of a mat2
equals( a, b) bool
Returns whether or not the matrices have approximately the same elements in the same position.
exactEquals( a, b) bool
Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
frob( a)
Returns Frobenius norm of a mat2
fromRotation( out, double rad) → dynamic
Creates a matrix from a given angle This is equivalent to (but much faster than):
fromScaling( out, 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( out) List<double>
Set a mat2 to the identity matrix
invert( out, a) List<double>?
Inverts a mat2
LDU( L, D, U, a) List<>
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( out, a, b) List<double>
Multiplies two mat2's
multiplyScalar( out, a, ) List<double>
Multiply each element of the matrix by a scalar.
multiplyScalarAndAdd( out, a, b, double scale) List<double>
Adds two mat2's after multiplying each element of the second operand by a scalar value.
rotate( out, a, double rad) List<double>
Rotates a mat2 by the given angle
scale( out, a, v) → dynamic
Scales the mat2 by the dimensions in the given vec2
set( out, double m00, double m01, double m10, double m11) List<double>
Set the components of a mat2 to the given values
str( a)
Returns a string representation of a mat2
subtract( out, a, b) List<double>
Subtracts matrix b from matrix a
transpose( out, a) List<double>
Transpose the values of a mat2