Module

GLMatrix.Mat2

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

#Mat2 Source

data Mat2 :: Type

Instances

#LDU Source

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

#add Source

add :: Mat2 -> Mat2 -> Mat2

Adds two mat2's

#adjoint Source

adjoint :: Mat2 -> Mat2

Calculates the adjugate of a mat2

#determinant Source

determinant :: Mat2 -> Number

Calculates the determinant of a mat2

#equals Source

equals :: Mat2 -> Mat2 -> Boolean

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

#frob Source

frob :: Mat2 -> Number

Returns Frobenius norm of a mat2

#fromRotation Source

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);

#fromValues Source

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

Create a new mat2 with the given values

#identity Source

identity :: Mat2

Set a mat2 to the identity matrix

#invert Source

invert :: Mat2 -> Mat2

Inverts a mat2

#ldu Source

ldu :: Mat2 -> LDU

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

#multiply Source

multiply :: Mat2 -> Mat2 -> Mat2

Multiplies two mat2's

#multiplyScalar Source

multiplyScalar :: Mat2 -> Number -> Mat2

Multiply each element of the matrix by a scalar

#multiplyScalarAndAdd Source

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

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

#rotate Source

rotate :: Mat2 -> Number -> Mat2

Rotates a mat2 by the given angle

#subtract Source

subtract :: Mat2 -> Mat2 -> Mat2

Subtracts matrix b from matrix a

#transpose Source

transpose :: Mat2 -> Mat2

Transpose the values of a mat2

#numbers Source

numbers :: Mat2 -> Array Number

Extract a number array

#map Source

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 Source

unsafeFromNumbers :: Partial => Array Number -> Mat2

Create a matrix from an array produced by numbers.

#zipWith Source

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

#slice Source

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

Like Array.slice