# GLMatrix.Mat4

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

### #FieldOfView Source

`type FieldOfView = { downDegrees :: Number, leftDegrees :: Number, rightDegrees :: Number, upDegrees :: Number }`

### #fieldOfView Source

`fieldOfView :: Number -> Number -> Number -> Number -> FieldOfView`

### #determinant Source

`determinant :: Mat4 -> Number`

Calculates the determinant of a Mat4

### #fromRotation Source

`fromRotation :: Number -> Vec3 -> Mat4`

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

### #fromScaling Source

`fromScaling :: Vec3 -> Mat4`

Creates a matrix from a vector scaling This is equivalent to (but much faster than): mat4.identity(dest); mat4.scale(dest, dest, vec);

### #fromTranslation Source

`fromTranslation :: Vec3 -> Mat4`

Creates a matrix from a vector translation This is equivalent to (but much faster than): mat4.identity(dest); mat4.translate(dest, dest, vec);

### #fromXRotation Source

`fromXRotation :: Number -> Mat4`

Creates a matrix from the given angle around the X axis This is equivalent to (but much faster than): mat4.identity(dest); mat4.rotateX(dest, dest, rad);

### #fromYRotation Source

`fromYRotation :: Number -> Mat4`

Creates a matrix from the given angle around the Y axis This is equivalent to (but much faster than): mat4.identity(dest); mat4.rotateY(dest, dest, rad);

### #fromZRotation Source

`fromZRotation :: Number -> Mat4`

Creates a matrix from the given angle around the Z axis This is equivalent to (but much faster than): mat4.identity(dest); mat4.rotateZ(dest, dest, rad);

### #getScaling Source

`getScaling :: Mat4 -> Vec3`

Returns the scaling factor component of a transformation matrix. If a matrix is built with fromRotationTranslationScale with a normalized Quaternion paramter, the returned vector will be the same as the scaling vector originally supplied.

### #getTranslation Source

`getTranslation :: Mat4 -> Vec3`

Returns the translation vector component of a transformation matrix. If a matrix is built with fromRotationTranslation, the returned vector will be the same as the translation vector originally supplied.

### #multiplyScalar Source

`multiplyScalar :: Mat4 -> Number -> Mat4`

Multiply each element of the matrix by a scalar

### #multiplyScalarAndAdd Source

`multiplyScalarAndAdd :: Mat4 -> Mat4 -> Number -> Mat4`

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

### #perspectiveFromFieldOfView Source

`perspectiveFromFieldOfView :: FieldOfView -> Number -> Number -> Mat4`

Generates a perspective projection matrix with the given field of view. This is primarily useful for generating projection matrices to be used with the still experiemental WebVR API.