Matrix4

Overview

Matrix4 is a class in Aspose.3D FOSS for Typescript.

Matrix4.constructor creates a new 4x4 matrix, optionally from a 16‑element number array.

This class provides 17 methods for working with Matrix4 objects in Typescript programs. Available methods include: concatenate, constructor, decompose, equals, getItem, identity, inverse, normalize, rotate, rotateFromEuler, scale, setItem, and 5 additional methods. All public members are accessible to any Typescript application after installing the Aspose.3D FOSS for Typescript package. Properties: determinant, m00, m01, m02, m03, m10, and 11 more.

Properties

NameTypeAccessDescription
m00numberRead/WriteGets the m00.
m01numberRead/WriteGets the m01.
m02numberRead/WriteGets the m02.
m03numberRead/WriteGets the m03.
m10numberRead/WriteGets the m10.
m11numberRead/WriteGets the m11.
m12numberRead/WriteGets the m12.
m13numberRead/WriteGets the m13.
m20numberRead/WriteGets the m20.
m21numberRead/WriteGets the m21.
m22numberRead/WriteGets the m22.
m23numberRead/WriteGets the m23.
m30numberRead/WriteGets the m30.
m31numberRead/WriteGets the m31.
m32numberRead/WriteGets the m32.
m33numberRead/WriteGets the m33.
determinantnumberReadGets the determinant.

Methods

SignatureDescription
constructor()Creates a new 4x4 matrix, optionally from a 16‑element number array
constructor(matrix: number[])
constructor()
constructor()
getItem(key: number)numberReturns the matrix element at the given linear index
setItem(key: number, value: number)Sets the item value.
transpose()Matrix4Returns a new Matrix4 that is the transpose of this matrix
concatenate(m2: Matrix4)Matrix4
normalize()Matrix4Returns a new Matrix4 with uniform scaling removed (unit length axes)
inverse()Matrix4
decompose(translation: any[], scaling: any[], rotation: any[])Extracts translation, scaling, and rotation into the supplied arrays
setTRS(translation: any, rotation: any, scale: any)Sets the trs value.
toArray()number[]Returns the matrix elements as a 16‑length number array in row‑major order
identity()Matrix4Resets the matrix to the identity matrix and returns this instance
translate(tx: number, ty: number, tz: number)Matrix4Applies a translation by (tx,ty,tz) or a vector and returns this matrix
translate(v: any)Matrix4
translate(tx: any, ty: any, tz: any)Matrix4
scale(sx: number, sy: number, sz: number)Matrix4Applies scaling by (sx,sy,sz) or a vector and returns this matrix
scale(v: any)Matrix4
scale(sx: any, sy: any, sz: any)Matrix4
rotateFromEuler(rx: number, ry: number, rz: number)Matrix4
rotateFromEuler(v: any)Matrix4
rotateFromEuler(rx: any, ry: any, rz: any)Matrix4
rotate(angle: number, axis: any)Matrix4Creates a rotation matrix from an angle and axis or from a quaternion
rotate(q: Quaternion)Matrix4
rotate(angle: any, axis: any)Matrix4
toString()stringReturns a human‑readable string representation of the matrix values
equals(other: Matrix4)booleanCompares this matrix with another for element‑wise equality

See Also