Module

Data.Matrix4

Package
purescript-matrix
Repository
jutaro/purescript-matrix

Inspired by Mjs library for javascript

#Vec3N Source

#Vec4N Source

#identity Source

#transform Source

transform :: Mat4 -> Vec3N -> Vec3N

Multiply a V.Vector by a 4x4 matrix: m * v

#inverseOrthonormal Source

inverseOrthonormal :: Mat4 -> Mat4

Computes the inverse of the given matrix m, assuming that the matrix is

#makeFrustum Source

makeFrustum :: Number -> Number -> Number -> Number -> Number -> Number -> Mat4

Creates a matrix for a projection frustum with the given parameters.

#makePerspective Source

makePerspective :: Number -> Number -> Number -> Number -> Mat4

Creates a matrix for a perspective projection with the given parameters.

#makeOrtho Source

makeOrtho :: Number -> Number -> Number -> Number -> Number -> Number -> Mat4

Creates a matrix for an orthogonal frustum projection with the given parameters.

#makeOrtho2D Source

makeOrtho2D :: Number -> Number -> Number -> Number -> Mat4

Creates a matrix for a 2D orthogonal frustum projection with the given

#mulM Source

mulM :: Mat4 -> Mat4 -> Mat4

Matrix multiplcation: a * b

#mulAffine Source

mulAffine :: Mat4 -> Mat4 -> Mat4

Matrix multiplication, assuming a and b are affine: a * b

#makeRotate Source

makeRotate :: Number -> Vec3N -> Mat4

Creates a transformation matrix for rotation in radians about the 3-element V.Vector axis.

#rotate Source

rotate :: Number -> Vec3N -> Mat4 -> Mat4

Concatenates a rotation in radians about an axis to the given matrix.

#makeScale3 Source

makeScale3 :: Number -> Number -> Number -> Mat4

Creates a transformation matrix for scaling by 3 scalar values, one for

#makeScale Source

makeScale :: Vec3N -> Mat4

Creates a transformation matrix for scaling each of the x, y, and z axes by

#scale3 Source

scale3 :: Number -> Number -> Number -> Mat4 -> Mat4

Concatenates a scaling to the given matrix.

#scale Source

scale :: Vec3N -> Mat4 -> Mat4

Concatenates a scaling to the given matrix.

#makeTranslate3 Source

makeTranslate3 :: Number -> Number -> Number -> Mat4

Creates a transformation matrix for translating by 3 scalar values, one for

#makeTranslate Source

makeTranslate :: Vec3N -> Mat4

Creates a transformation matrix for translating each of the x, y, and z

#translate3 Source

translate3 :: Number -> Number -> Number -> Mat4 -> Mat4

Concatenates a translation to the given matrix.

#translate Source

translate :: Vec3N -> Mat4 -> Mat4

Concatenates a translation to the given matrix.

#makeLookAt Source

makeLookAt :: Vec3N -> Vec3N -> Vec3N -> Mat4

Creates a transformation matrix for a camera.

#makeBasis Source

makeBasis :: Vec3N -> Vec3N -> Vec3N -> Mat4

Creates a transform from a basis consisting of 3 linearly independent V.Vectors.

#project Source

#unProject Source

#mulMatVect Source