Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new Mat3(): Mat3
  • new Mat3(m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): Mat3
  • new Mat3(elements?: number[]): Mat3

Properties

elements

elements: number[] = []

Accessors

c0

c1

c2

m00

  • get m00(): number
  • set m00(value: number): void
  • For function mxy(), gets or sets the element of the matrix at the position [x, y]

    Returns number

  • For function mxy(), gets or sets the element of the matrix at the position [x, y]

    Parameters

    • value: number

    Returns void

m01

  • get m01(): number
  • set m01(value: number): void

m02

  • get m02(): number
  • set m02(value: number): void

m10

  • get m10(): number
  • set m10(value: number): void

m11

  • get m11(): number
  • set m11(value: number): void

m12

  • get m12(): number
  • set m12(value: number): void

m20

  • get m20(): number
  • set m20(value: number): void

m21

  • get m21(): number
  • set m21(value: number): void

m22

  • get m22(): number
  • set m22(value: number): void

r0

r1

r2

Methods

Mat4From2DH

Mat4Linear

Protected _timesMatrix

Private _timesVector

  • if it's a Vec3 we do regular matrix vector multiplication. If it's a Vec2, we treat it as a point and add a homogeneous value of 1, then do the multiplication, then homogenize and drop the homogeneous coordinate to return a new Vec2.

    Parameters

    Returns Vec2 | Vec3

applyToPoints

asPrettyString

  • asPrettyString(precision?: number): string

clone

determinant

  • determinant(): number

getElement

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

getInverse

  • getInverse(): null | Mat3

getMatrix

getTranspose

  • getTranspose(): Mat3

isEqualTo

  • isEqualTo(other: Mat3, tolerance?: number): boolean

minus

plus

setToIdentity

  • setToIdentity(): void

times

toJSON

  • toJSON(): {}

Static FromColumns

  • Returns this matrix made up of the columns c0, c1, c2.

    Parameters

    • c0: Vec3

      The first column

    • c1: Vec3

      The second column

    • c2: Vec3

      The third column

    Returns Mat3

    this matrix with the specified columns

Static FromRows

Static Identity

Static Ones

Static Product

  • Product<T>(...args: any[]): Matrix
  • For taking the product of a series of matrices in order. You can feed in matrices as separate arguments or as a single list. E.g., Multiply(a, b, c, d) or Multiply([a,b,c,d]).

    Type parameters

    Parameters

    • Rest ...args: any[]

    Returns Matrix

Static Random

Static Rotation

  • Rotation(radians: number): Mat3
  • Returns the corresponding rotation transformation matrix for the given radians.

    Parameters

    • radians: number

      the rotation amount in radians

    Returns Mat3

    the rotation transformation matrix

Static Scale2D

  • Returns the corresponding 2D scale transformation matrix for the given scaling factor.

    If factor is a number, then uses the factor for scaling in the x and y directions. If factor is an array of length two, then uses the factor[0] as the x direction and factor[1] as the y-direction. If factor is a Vec2, then uses the factor[0] as the x-direction and factor[1] as the y-direction.

    Parameters

    • factors: number[]

    Returns Mat3

  • Parameters

    Returns Mat3

  • Parameters

    Returns Mat3

Static Scale3D

  • Scale3D(factor: number): Mat3
  • Scale3D(factors: number[]): Mat3
  • Scale3D(factors: Vec3): Mat3
  • Returns the corresponding 3D scale transformation matrix given the scaling factor.

    If factor is a number, then uses the factor for scaling in the x and y direction. If factor is an array of length three, then uses the factor[0] as the x direction, factor[1] as the y direction, and factor[2] as the z-direction. If factor is a Vec3, then uses the factor[0] as the x-direction, factor[1] as the y-direction, and factor[2] as the z-direction.

    Parameters

    • factor: number

      the scaling factor

    Returns Mat3

  • Parameters

    • factors: number[]

    Returns Mat3

  • Parameters

    Returns Mat3

Static Translation2D

  • Translation2D(t: number[]): Mat3
  • Translation2D(t: Vec2): Mat3
  • Translation2D(x: number, y: number): Mat3
  • Returns the corresponding 2D translation transformation matrix for the given translation t or x and y.

    If the argument is x and y, then it translates in the x-direction x amount and in the y-direction y amount. If t is an array of length two, then uses the t[0] as the x-direction and t[1] as the y-direction. If t is a Vec2, then uses the t[0] as the x-direction and t[1] as the y-direction.

    Parameters

    • t: number[]

      the translation factor

    Returns Mat3

  • Parameters

    Returns Mat3

  • Parameters

    • x: number
    • y: number

    Returns Mat3

Static Zeros

Generated using TypeDoc