Module

# Data.Matrix4

Package
purescript-matrix
Repository
jutaro/purescript-matrix

Inspired by Mjs library for javascript

### #Vec3NSource

``type Vec3N = Vec3 Number``

### #Vec4NSource

``type Vec4N = Vec4 Number``

### #Mat4Source

``type Mat4 = Mat Four Number``

### #mat4Source

``mat4 :: Array Number -> Mat4``

### #identitySource

``identity :: Mat4``

### #transformSource

``transform :: Mat4 -> Vec3N -> Vec3N``

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

### #inverseOrthonormalSource

``inverseOrthonormal :: Mat4 -> Mat4``

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

### #inverseSource

``inverse :: Mat4 -> Maybe Mat4``

### #makeFrustumSource

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

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

### #makePerspectiveSource

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

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

### #makeOrthoSource

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

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

### #makeOrtho2DSource

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

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

### #mulMSource

``mulM :: Mat4 -> Mat4 -> Mat4``

Matrix multiplcation: a * b

### #mulAffineSource

``mulAffine :: Mat4 -> Mat4 -> Mat4``

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

### #makeRotateSource

``makeRotate :: Number -> Vec3N -> Mat4``

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

### #rotateSource

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

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

### #makeScale3Source

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

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

### #makeScaleSource

``makeScale :: Vec3N -> Mat4``

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

### #scale3Source

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

Concatenates a scaling to the given matrix.

### #scaleSource

``scale :: Vec3N -> Mat4 -> Mat4``

Concatenates a scaling to the given matrix.

### #makeTranslate3Source

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

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

### #makeTranslateSource

``makeTranslate :: Vec3N -> Mat4``

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

### #translate3Source

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

Concatenates a translation to the given matrix.

### #translateSource

``translate :: Vec3N -> Mat4 -> Mat4``

Concatenates a translation to the given matrix.

### #makeLookAtSource

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

Creates a transformation matrix for a camera.

### #makeBasisSource

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

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

### #projectSource

``project :: Vec3N -> Mat4 -> Mat4 -> Vec4N -> Maybe Vec3N``

### #unProjectSource

``unProject :: Vec3N -> Mat4 -> Mat4 -> Vec4N -> Maybe Vec3N``

### #mulMatVectSource

``mulMatVect :: Mat4 -> Vec4N -> Vec4N``