Module

# GLMatrix.Mat2d

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

### #Mat2dSource

``data Mat2d :: Type``

#### Instances

• `Show Mat2d`
• `Eq Mat2d`

``add :: Mat2d -> Mat2d -> Mat2d``

### #determinantSource

``determinant :: Mat2d -> Number``

Calculates the determinant of a Mat2d

### #equalsSource

``equals :: Mat2d -> Mat2d -> Boolean``

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

### #frobSource

``frob :: Mat2d -> Number``

Returns Frobenius norm of a Mat2d

### #fromRotationSource

``fromRotation :: Number -> Mat2d``

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

### #fromValuesSource

``fromValues :: Number -> Number -> Number -> Number -> Number -> Number -> Mat2d``

Create a new Mat2d with the given values

### #identitySource

``identity :: Mat2d``

Set a Mat2d to the identity matrix

### #invertSource

``invert :: Mat2d -> Mat2d``

Inverts a Mat2d

### #multiplySource

``multiply :: Mat2d -> Mat2d -> Mat2d``

Multiplies two Mat2d's

### #multiplyScalarSource

``multiplyScalar :: Mat2d -> Number -> Mat2d``

Multiply each element of the matrix by a scalar

``multiplyScalarAndAdd :: Mat2d -> Mat2d -> Number -> Mat2d``

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

### #rotateSource

``rotate :: Mat2d -> Number -> Mat2d``

Rotates a Mat2d by the given angle

### #subtractSource

``subtract :: Mat2d -> Mat2d -> Mat2d``

Subtracts matrix b from matrix a

``numbers :: Mat2d -> Array Number``

Extract a number array

### #mapSource

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

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 -> Mat2d``

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

### #zipWithSource

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

### #sliceSource

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

Like `Array.slice`