Preparing search index...

    2x2 column-major floating-point matrix.

        const identity = new mat2();
    console.log('mat2 identity column0:', identity.column0.x, identity.column0.y);
    console.log('mat2 identity column1:', identity.column1.x, identity.column1.y);

    const custom = new mat2();
    custom.column0 = new vec2(2, 0);
    custom.column1 = new vec2(0, 3);
    console.log('Custom mat2 column0:', custom.column0.x, custom.column0.y);
    console.log('Custom mat2 column1:', custom.column1.x, custom.column1.y);
    Index

    Constructors

    • Constructs a new mat2 initialized to the identity matrix.

      Returns mat2

    Properties

    column0: vec2

    First column of the matrix as a vec2.

    column1: vec2

    Second column of the matrix as a vec2.

    description: string

    Human-readable description string for this matrix instance.

    Methods

    • Adds another mat2 to this matrix and returns the result.

      Parameters

      Returns mat2

    • Returns the scalar determinant of this matrix.

      Returns number

    • Divides this matrix by another mat2 element-wise and returns the result.

      Parameters

      Returns mat2

    • Returns true if this matrix equals the given mat2.

      Parameters

      Returns boolean

    • Returns a mat2 set to the identity matrix.

      Returns mat2

    • Returns the inverse of this matrix.

      Returns mat2

    • Multiplies this matrix by another mat2 and returns the result.

      Parameters

      Returns mat2

    • Multiplies each element of this matrix by a scalar and returns the result.

      Parameters

      • scalar: number

      Returns mat2

    • Subtracts another mat2 from this matrix and returns the result.

      Parameters

      Returns mat2

    • Returns a string representation of this matrix.

      Returns string

    • Returns the transpose of this matrix.

      Returns mat2

    • Returns a mat2 with all elements set to zero.

      Returns mat2