Interface IMutableMatrix22

Interface for mutable 2x2 matrices. Provides modifiable 2x2 matrix operations for 2D transformations.

interface IMutableMatrix22 {
    m00: number;
    m01: number;
    m10: number;
    m11: number;
    _swap(l: number, r: number): void;
    at(row_i: number, column_i: number): number;
    clone(): IMutableMatrix22;
    copyComponents(mat: IMatrix22 | IMatrix33 | IMatrix44): IMutableMatrix22;
    determinant(): number;
    flattenAsArray(): number[];
    getScale(): IVector2;
    getScaleTo(outVec: IMutableVector2): IMutableVector2;
    identity(): IMutableMatrix22;
    invert(): IMutableMatrix22;
    isDummy(): boolean;
    isEqual(mat: IMatrix22, delta?: number): boolean;
    isStrictEqual(mat: IMatrix22): boolean;
    multiply(mat: IMatrix22): IMutableMatrix22;
    multiplyByLeft(mat: IMatrix22): IMutableMatrix22;
    multiplyScale(vec: IVector2): IMutableMatrix22;
    multiplyVector(vec: IVector2): IVector2;
    multiplyVectorTo(vec: IVector2, outVec: IMutableVector2): IMutableVector2;
    raw(): TypedArray;
    rotate(radian: number): IMutableMatrix22;
    scale(vec: IVector2): IMutableMatrix22;
    setAt(row_i: number, column_i: number, value: number): IMutableMatrix22;
    setComponents(m00: number, m01: number, m10: number, m11: number): IMutableMatrix22;
    toString(): string;
    toStringApproximately(): string;
    transpose(): IMutableMatrix22;
    zero(): IMutableMatrix22;
}

Implemented by

Properties

m00: number

Element at row 0, column 0

m01: number

Element at row 0, column 1

m10: number

Element at row 1, column 0

m11: number

Element at row 1, column 1

Methods

  • Swaps two elements in the internal array.

    Parameters

    • l: number

      Left index

    • r: number

      Right index

    Returns void

  • Gets the value at the specified row and column.

    Parameters

    • row_i: number

      Row index (0-based)

    • column_i: number

      Column index (0-based)

    Returns number

    Value at the specified position

  • Flattens the matrix into a plain JavaScript array.

    Returns number[]

    Array containing all matrix elements

  • Checks if this is a dummy/placeholder matrix.

    Returns boolean

    True if this is a dummy matrix

  • Checks if this matrix is approximately equal to another matrix.

    Parameters

    • mat: IMatrix22

      Matrix to compare against

    • Optionaldelta: number

      Optional tolerance for comparison (default: small epsilon)

    Returns boolean

    True if matrices are approximately equal

  • Checks if this matrix is strictly equal to another matrix.

    Parameters

    Returns boolean

    True if matrices are exactly equal

  • Sets all matrix components from individual values.

    Parameters

    • m00: number

      Element at row 0, column 0

    • m01: number

      Element at row 0, column 1

    • m10: number

      Element at row 1, column 0

    • m11: number

      Element at row 1, column 1

    Returns IMutableMatrix22

    This matrix for method chaining

  • Converts the matrix to a string representation.

    Returns string

    String representation of the matrix

  • Converts the matrix to an approximate string representation.

    Returns string

    Approximate string representation with rounded values