Options
All
• Public
• Public/Protected
• All

A 4x4 (square) matrix of numbers.

An adapter for a `Float32Array`.

## Constructors

### constructor

• new Matrix4(elements: Float32Array): Matrix4

## Properties

### modified

modified: boolean

one: Matrix4 = lock(new Matrix4(new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])))

The identity matrix for multiplication, 1. The matrix is locked (immutable), but may be cloned.

zero: Matrix4 = lock(new Matrix4(new Float32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])))

The identity matrix for addition, 0. The matrix is locked (immutable), but may be cloned.

## Accessors

### dimensions

• get dimensions(): number
• set dimensions(unused: number): void

### elements

• get elements(): Float32Array
• set elements(elements: Float32Array): void

## Methods

### __rmul__

#### Returns Matrix4

• Sets this matrix to `this + rhs`.

#### Returns this

• Sets this matrix to `a + b`.

### compose

• compose(S: VectorE3, R: SpinorE3, T: VectorE3): this
• Sets this matrix to perform the specified scaling, rotation, and translation.

### det

• det(): number

### frustum

• frustum(left: number, right: number, bottom: number, top: number, near: number, far: number): this

### getElement

• getElement(row: number, column: number): number

• inv(): this

### isLocked

• isLocked(): boolean

### isOne

• isOne(): boolean

### lock

• lock(): number

### one

• one(): this
• Sets this matrix to the identity element for multiplication, 1.

### perspective

• perspective(fov: number, aspect: number, near: number, far: number): this
• Sets this matrix to the viewing transformation. This is the matrix that may be applied to points in the truncated viewing pyramid. The resulting points then lie in the image space (cube).

### reflection

• reflection(n: VectorE3): this
• Sets this matrix to the transformation for a reflection in the plane normal to the unit vector `n`.

this ⟼ reflection(n)

### rotate

• rotate(spinor: SpinorE3): this
• this ⟼ rotation(spinor) * this

### rotation

• rotation(spinor: SpinorE3): this
• Sets this matrix to be equivalent to the spinor.

this ⟼ rotation(spinor)

### rotationAxis

• rotationAxis(axis: VectorE3, angle: number): this

### row

• row(i: number): Array<number>
• #### Parameters

• ##### i: number

the zero-based index of the row.

### scale

• scale(s: number): this
• Multiplies all elements of this matrix by the specified value.

### scaleXYZ

• scaleXYZ(scale: VectorE3): this

### scaling

• scaling(scale: VectorE3): this

### set

• set(n11: number, n12: number, n13: number, n14: number, n21: number, n22: number, n23: number, n24: number, n31: number, n32: number, n33: number, n34: number, n41: number, n42: number, n43: number, n44: number): this

### setElement

• setElement(row: number, column: number, value: number): void
• #### Parameters

• ##### row: number

The zero-based row.

• ##### column: number

The zero-based column.

• ##### value: number

The value of the element.

### toExponential

• toExponential(fractionDigits?: number): string

### toFixed

• toFixed(fractionDigits?: number): string

### toPrecision

• toPrecision(fractionDigits?: number): string

### translate

• translate(d: VectorE3): this
• this ⟼ translation(spinor) * this

### translation

• translation(displacement: VectorE3): this
• Sets this matrix to be equivalent to the displacement vector argument.

### transpose

• transpose(): this

### unlock

• unlock(token: number): void

• zero(): this

### Static rotation

• rotation(spinor: SpinorE3): Matrix4
• Constructs a 4x4 matrix that performs the rotation specified by the spinor.

### Static scaling

• scaling(scale: VectorE3): Matrix4
• Constructs a 4x4 matrix that performs the scaling specified by the vector.

### Static translation

• translation(vector: VectorE3): Matrix4
• Constructs a 4x4 matrix that performs the translation specified by the vector.

## Legend

• Constructor
• Property
• Method
• Accessor
• Inherited property
• Inherited method
• Inherited accessor
• Property
• Method
• Protected property
• Protected method
• Static property
• Static method

Generated using TypeDoc