Module

GLMatrix.Mat2

#Mat2

data Mat2 :: Type

Instances

#LDU

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

#add

add :: Mat2 -> Mat2 -> Mat2

Adds two mat2's

#adjoint

adjoint :: Mat2 -> Mat2

Calculates the adjugate of a mat2

#determinant

determinant :: Mat2 -> Number

Calculates the determinant of a mat2

#equals

equals :: Mat2 -> Mat2 -> Boolean

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

#frob

frob :: Mat2 -> Number

Returns Frobenius norm of a mat2

#fromRotation

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

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

Create a new mat2 with the given values

#identity

identity :: Mat2

Set a mat2 to the identity matrix

#invert

invert :: Mat2 -> Mat2

Inverts a mat2

#ldu

ldu :: Mat2 -> LDU

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

#multiply

multiply :: Mat2 -> Mat2 -> Mat2

Multiplies two mat2's

#multiplyScalar

multiplyScalar :: Mat2 -> Number -> Mat2

Multiply each element of the matrix by a scalar

#multiplyScalarAndAdd

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

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

#rotate

rotate :: Mat2 -> Number -> Mat2

Rotates a mat2 by the given angle

#subtract

subtract :: Mat2 -> Mat2 -> Mat2

Subtracts matrix b from matrix a

#transpose

transpose :: Mat2 -> Mat2

Transpose the values of a mat2

#numbers

numbers :: Mat2 -> Array Number

Extract a number array

#map

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

unsafeFromNumbers :: Partial => Array Number -> Mat2

Create a matrix from an array produced by numbers.

#zipWith

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

#slice

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

Like Array.slice

Modules