Hierarchy

Constructors

  • 2x2 (square) matrix of numbers. Constructs a Matrix2 by wrapping a Float32Array. The elements are stored in column-major order: 0 2 1 3

    Parameters

    • elements: Float32Array

      The elements of the matrix in column-major order.

    Returns Matrix2

Properties

modified: boolean
one: Matrix2 = ...
zero: Matrix2 = ...

Accessors

Methods

  • Parameters

    • row: number

      The zero-based row.

    • column: number

      The zero-based column.

    Returns number

  • Determines whether this Lockable is locked. If the Lockable is in the unlocked state then it is mutable. If the Lockable is in the locked state then it is immutable.

    Returns boolean

  • Determines whether this matrix is the identity matrix for multiplication.

    Returns boolean

  • Determines whether this matrix is the identity matrix for addition.

    Returns boolean

  • Locks this Lockable (preventing any further mutation), and returns a token that may be used to unlock it.

    Returns number

  • Returns the row for the specified index.

    Parameters

    • i: number

      the zero-based index of the row.

    Returns number[]

  • Sets all elements of this matrix to the supplied row-major values m11, ..., m22.

    Parameters

    • m11: number
    • m12: number
    • m21: number
    • m22: number

    Returns this

    set

  • Parameters

    • row: number

      The zero-based row.

    • column: number

      The zero-based column.

    • value: number

      The value of the element.

    Returns void

  • Parameters

    • OptionalfractionDigits: number

    Returns string

    toExponential

  • Parameters

    • OptionalfractionDigits: number

    Returns string

    toFixed

  • Parameters

    • Optionalprecision: number

    Returns string

    toPrecision

  • Unlocks this Lockable (allowing mutation), using a token that was obtained from a preceding lock method call.

    Parameters

    • token: number

    Returns void