The class representing a 3x3 matrix.

Constructors

  • Create a 3x3 matrix with the given arguments in row-major order. If no arguments are provided, the constructor initializes the Matrix3 to the 3x3 identity matrix.

    Parameters

    • Optionaln11: number

      Input element in the first row and the first column

    • Optionaln12: number

      Input element in the first row and the second column

    • Optionaln13: number

      Input element in the first row and the third column

    • Optionaln21: number

      Input element in the second row and the first column

    • Optionaln22: number

      Input element in the second row and the second column

    • Optionaln23: number

      Input element in the second row and the third column

    • Optionaln31: number

      Input element in the third row and the first column

    • Optionaln32: number

      Input element in the third row and the second column

    • Optionaln33: number

      Input element in the third row and the third column

    Returns AcGeMatrix2d

Properties

elements: number[]

A column-major list of matrix values.

IDENTITY: Readonly<AcGeMatrix2d> = ...

Identity matrix.

Methods

  • Compute and return the determinant of this matrix.

    Returns number

    Return the determinant of this matrix

  • Set the elements of this matrix based on an array in column-major format.

    Parameters

    • array: number[]

      Input the array to read the elements from.

    • offset: number = 0

      Input (optional) index of first element in the array. Default is 0.

    Returns AcGeMatrix2d

    Return this matrix

  • Invert this matrix, using the analytic method. You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.

    Returns AcGeMatrix2d

    Return this matrix

  • Set this matrix as a 2D rotational transformation by theta radians

    Parameters

    • theta: number

      Input rotation angle in radians. Positive values rotate counterclockwise.

    Returns AcGeMatrix2d

    Return this matrix

  • Set this matrix as a 2D scale transform

    Parameters

    • x: number

      Input the amount to scale in the X axis.

    • y: number

      Input the amount to scale in the Y axis.

    Returns AcGeMatrix2d

    Return this matrix

  • Scale this matrix with the given scalar values.

    Parameters

    • sx: number

      Input one scalar value

    • sy: number

      Input one scalar value

    Returns AcGeMatrix2d

    Return this matrix

  • Set the 3x3 matrix values to the given row-major sequence of values.

    Parameters

    • n11: number

      Input element in the first row and the first column

    • n12: number

      Input element in the first row and the second column

    • n13: number

      Input element in the first row and the third column

    • n21: number

      Input element in the second row and the first column

    • n22: number

      Input element in the second row and the second column

    • n23: number

      Input element in the second row and the third column

    • n31: number

      Input element in the third row and the first column

    • n32: number

      Input element in the third row and the second column

    • n33: number

      Input element in the third row and the third column

    Returns AcGeMatrix2d

    Return this matrix

  • Set the UV transform matrix from offset, repeat, rotation, and center.

    Parameters

    • tx: number

      Input offset x

    • ty: number

      Input offset y

    • sx: number

      Input repeat x

    • sy: number

      Input repeat y

    • rotation: number

      Input rotation, in radians. Positive values rotate counterclockwise

    • cx: number

      Input center x of rotation

    • cy: number

      Input center y of rotation

    Returns AcGeMatrix2d

    Return this matrix

  • Write the elements of this matrix to an array in column-major format.

    Parameters

    • array: number[] = []

      Input (optional) array to store the resulting vector in. If not given a new array will be created.

    • offset: number = 0

      Input (optional) offset in the array at which to put the result.

    Returns number[]

    Return this matrix

  • Translate this matrix by the given scalar values.

    Parameters

    • tx: number

      Input one scalar value

    • ty: number

      Input one scalar value

    Returns AcGeMatrix2d

    Return this matrix