Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace mat3

Index

Functions

add

  • add(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3
  • Adds two mat3's

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the first operand

    • b: ReadonlyMat3

      the second operand

    Returns mat3

    out

adjoint

  • adjoint(out: mat3, a: ReadonlyMat3): mat3
  • Calculates the adjugate of a mat3

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the source matrix

    Returns mat3

    out

clone

  • clone(a: ReadonlyMat3): mat3
  • Creates a new mat3 initialized with values from an existing matrix

    Parameters

    • a: ReadonlyMat3

      matrix to clone

    Returns mat3

    a new 3x3 matrix

copy

  • copy(out: mat3, a: ReadonlyMat3): mat3
  • Copy the values from one mat3 to another

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the source matrix

    Returns mat3

    out

create

  • Creates a new identity mat3

    Returns mat3

    a new 3x3 matrix

determinant

  • determinant(a: ReadonlyMat3): number
  • Calculates the determinant of a mat3

    Parameters

    • a: ReadonlyMat3

      the source matrix

    Returns number

    determinant of a

equals

  • equals(a: ReadonlyMat3, b: ReadonlyMat3): boolean
  • Returns whether or not the matrices have approximately the same elements in the same position.

    Parameters

    • a: ReadonlyMat3

      The first matrix.

    • b: ReadonlyMat3

      The second matrix.

    Returns boolean

    True if the matrices are equal, false otherwise.

exactEquals

  • exactEquals(a: ReadonlyMat3, b: ReadonlyMat3): boolean
  • Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

    Parameters

    • a: ReadonlyMat3

      The first matrix.

    • b: ReadonlyMat3

      The second matrix.

    Returns boolean

    True if the matrices are equal, false otherwise.

frob

  • frob(a: ReadonlyMat3): number
  • Returns Frobenius norm of a mat3

    Parameters

    • a: ReadonlyMat3

      the matrix to calculate Frobenius norm of

    Returns number

    Frobenius norm

fromMat2d

  • fromMat2d(out: mat3, a: ReadonlyMat2d): mat3
  • Copies the values from a mat2d into a mat3

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat2d

      the matrix to copy

    Returns mat3

    out

fromMat4

  • fromMat4(out: mat3, a: ReadonlyMat4): mat3
  • Copies the upper-left 3x3 values into the given mat3.

    Parameters

    • out: mat3

      the receiving 3x3 matrix

    • a: ReadonlyMat4

      the source 4x4 matrix

    Returns mat3

    out

fromQuat

  • fromQuat(out: mat3, q: ReadonlyQuat): mat3
  • Calculates a 3x3 matrix from the given quaternion

    Parameters

    • out: mat3

      mat3 receiving operation result

    • q: ReadonlyQuat

      Quaternion to create matrix from

    Returns mat3

    out

fromRotation

  • fromRotation(out: mat3, rad: number): mat3
  • Creates a matrix from a given angle This is equivalent to (but much faster than):

    mat3.identity(dest);
    mat3.rotate(dest, dest, rad);
    

    Parameters

    • out: mat3

      mat3 receiving operation result

    • rad: number

      the angle to rotate the matrix by

    Returns mat3

    out

fromScaling

  • fromScaling(out: mat3, v: ReadonlyVec2): mat3
  • Creates a matrix from a vector scaling This is equivalent to (but much faster than):

    mat3.identity(dest);
    mat3.scale(dest, dest, vec);
    

    Parameters

    • out: mat3

      mat3 receiving operation result

    • v: ReadonlyVec2

      Scaling vector

    Returns mat3

    out

fromTranslation

  • fromTranslation(out: mat3, v: ReadonlyVec2): mat3
  • Creates a matrix from a vector translation This is equivalent to (but much faster than):

    mat3.identity(dest);
    mat3.translate(dest, dest, vec);
    

    Parameters

    • out: mat3

      mat3 receiving operation result

    • v: ReadonlyVec2

      Translation vector

    Returns mat3

    out

fromValues

  • fromValues(m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): mat3
  • Create a new mat3 with the given values

    Parameters

    • m00: number

      Component in column 0, row 0 position (index 0)

    • m01: number

      Component in column 0, row 1 position (index 1)

    • m02: number

      Component in column 0, row 2 position (index 2)

    • m10: number

      Component in column 1, row 0 position (index 3)

    • m11: number

      Component in column 1, row 1 position (index 4)

    • m12: number

      Component in column 1, row 2 position (index 5)

    • m20: number

      Component in column 2, row 0 position (index 6)

    • m21: number

      Component in column 2, row 1 position (index 7)

    • m22: number

      Component in column 2, row 2 position (index 8)

    Returns mat3

    A new mat3

identity

  • Set a mat3 to the identity matrix

    Parameters

    • out: mat3

      the receiving matrix

    Returns mat3

    out

invert

  • invert(out: mat3, a: ReadonlyMat3): mat3
  • Inverts a mat3

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the source matrix

    Returns mat3

    out

mul

  • mul(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3
  • Multiplies two mat3's

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the first operand

    • b: ReadonlyMat3

      the second operand

    Returns mat3

    out

multiply

  • multiply(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3
  • Multiplies two mat3's

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the first operand

    • b: ReadonlyMat3

      the second operand

    Returns mat3

    out

multiplyScalar

  • multiplyScalar(out: mat3, a: ReadonlyMat3, b: number): mat3
  • Multiply each element of the matrix by a scalar.

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the matrix to scale

    • b: number

      amount to scale the matrix's elements by

    Returns mat3

    out

multiplyScalarAndAdd

  • multiplyScalarAndAdd(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3, scale: number): mat3
  • Adds two mat3's after multiplying each element of the second operand by a scalar value.

    Parameters

    • out: mat3

      the receiving vector

    • a: ReadonlyMat3

      the first operand

    • b: ReadonlyMat3

      the second operand

    • scale: number

      the amount to scale b's elements by before adding

    Returns mat3

    out

normalFromMat4

  • normalFromMat4(out: mat3, a: ReadonlyMat4): mat3
  • Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix

    Parameters

    • out: mat3

      mat3 receiving operation result

    • a: ReadonlyMat4

      Mat4 to derive the normal matrix from

    Returns mat3

    out

projection

  • projection(out: mat3, width: number, height: number): mat3
  • Generates a 2D projection matrix with the given bounds

    Parameters

    • out: mat3

      mat3 frustum matrix will be written into

    • width: number

      Width of your gl context

    • height: number

      Height of gl context

    Returns mat3

    out

rotate

  • rotate(out: mat3, a: ReadonlyMat3, rad: number): mat3
  • Rotates a mat3 by the given angle

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the matrix to rotate

    • rad: number

      the angle to rotate the matrix by

    Returns mat3

    out

scale

  • scale(out: mat3, a: ReadonlyMat3, v: ReadonlyVec2): mat3
  • Scales the mat3 by the dimensions in the given vec2

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the matrix to rotate

    • v: ReadonlyVec2

      the vec2 to scale the matrix by

    Returns mat3

    out

set

  • set(out: mat3, m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): mat3
  • Set the components of a mat3 to the given values

    Parameters

    • out: mat3

      the receiving matrix

    • m00: number

      Component in column 0, row 0 position (index 0)

    • m01: number

      Component in column 0, row 1 position (index 1)

    • m02: number

      Component in column 0, row 2 position (index 2)

    • m10: number

      Component in column 1, row 0 position (index 3)

    • m11: number

      Component in column 1, row 1 position (index 4)

    • m12: number

      Component in column 1, row 2 position (index 5)

    • m20: number

      Component in column 2, row 0 position (index 6)

    • m21: number

      Component in column 2, row 1 position (index 7)

    • m22: number

      Component in column 2, row 2 position (index 8)

    Returns mat3

    out

str

  • str(a: ReadonlyMat3): string
  • Returns a string representation of a mat3

    Parameters

    • a: ReadonlyMat3

      matrix to represent as a string

    Returns string

    string representation of the matrix

sub

  • sub(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3
  • Subtracts matrix b from matrix a

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the first operand

    • b: ReadonlyMat3

      the second operand

    Returns mat3

    out

subtract

  • subtract(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3
  • Subtracts matrix b from matrix a

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the first operand

    • b: ReadonlyMat3

      the second operand

    Returns mat3

    out

translate

  • translate(out: mat3, a: ReadonlyMat3, v: ReadonlyVec2): mat3
  • Translate a mat3 by the given vector

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the matrix to translate

    • v: ReadonlyVec2

      vector to translate by

    Returns mat3

    out

transpose

  • transpose(out: mat3, a: ReadonlyMat3): mat3
  • Transpose the values of a mat3

    Parameters

    • out: mat3

      the receiving matrix

    • a: ReadonlyMat3

      the source matrix

    Returns mat3

    out