Module

# GLMatrix.Mat2

Package
purescript-gl-matrix
Repository
dirkz/purescript-gl-matrix

### #Mat2Source

``data Mat2 :: Type``

#### Instances

• `Show Mat2`
• `Eq Mat2`

### #LDUSource

``type LDU = { d :: Mat2, l :: Mat2, u :: Mat2 }``

``add :: Mat2 -> Mat2 -> Mat2``

``adjoint :: Mat2 -> Mat2``

Calculates the adjugate of a mat2

### #determinantSource

``determinant :: Mat2 -> Number``

Calculates the determinant of a mat2

### #equalsSource

``equals :: Mat2 -> Mat2 -> Boolean``

Returns whether or not the matrices have approximately the same elements in the same position

### #frobSource

``frob :: Mat2 -> Number``

Returns Frobenius norm of a mat2

### #fromRotationSource

``fromRotation :: Number -> Mat2``

Creates a matrix from a given angle This is equivalent to (but much faster than): mat2.identity(dest); mat2.rotate(dest, dest, rad);

### #fromValuesSource

``fromValues :: Number -> Number -> Number -> Number -> Mat2``

Create a new mat2 with the given values

### #identitySource

``identity :: Mat2``

Set a mat2 to the identity matrix

### #invertSource

``invert :: Mat2 -> Mat2``

Inverts a mat2

### #lduSource

``ldu :: Mat2 -> LDU``

Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix

### #multiplySource

``multiply :: Mat2 -> Mat2 -> Mat2``

Multiplies two mat2's

### #multiplyScalarSource

``multiplyScalar :: Mat2 -> Number -> Mat2``

Multiply each element of the matrix by a scalar

``multiplyScalarAndAdd :: Mat2 -> Mat2 -> Number -> Mat2``

Adds two mat2's after multiplying each element of the second operand by a scalar value

### #rotateSource

``rotate :: Mat2 -> Number -> Mat2``

Rotates a mat2 by the given angle

### #subtractSource

``subtract :: Mat2 -> Mat2 -> Mat2``

Subtracts matrix b from matrix a

### #transposeSource

``transpose :: Mat2 -> Mat2``

Transpose the values of a mat2

``numbers :: Mat2 -> Array Number``

Extract a number array

### #mapSource

``map :: (Number -> Number) -> Mat2 -> Mat2``

Map a function from `Number` to `Number` over it. Note: Since this is not a general container, it cannot be a `Functor`.

``unsafeFromNumbers :: Partial => Array Number -> Mat2``

Create a matrix from an array produced by `numbers`.

### #zipWithSource

``zipWith :: (Number -> Number -> Number) -> Mat2 -> Mat2 -> Mat2``

### #sliceSource

``slice :: Int -> Int -> Mat2 -> Array Number``

Like `Array.slice`