Options
All
  • Public
  • Public/Protected
  • All
Menu

A 2-by-2 matrix. Stored in column-major order.

Hierarchy

  • b2Mat22

Index

Constructors

constructor

  • Empty constructor

    Returns b2Mat22

Properties

col1

col1: b2Vec2

Column 1

col2

col2: b2Vec2

Column 2

Methods

Abs

  • Abs(): void
  • Sets all internal matrix values to absolute values.

    Returns void

AddM

  • Adds the two 2x2 matricies together and stores the result in this matrix.

    Parameters

    Returns void

Copy

  • Creates a copy of the matrix.

    Returns b2Mat22

    Copy of this 2x2 matrix.

GetAngle

  • GetAngle(): number
  • Gets the rotation matrix angle. R(theta) = [ cos(theta) -sin(theta) ] [ sin(theta) cos(theta) ]

    Returns number

    The rotation matrix angle (theta).

GetInverse

  • Compute the inverse of this matrix, such that inv(A) A = identity.

    Parameters

    Returns b2Mat22

    Inverse matrix.

Set

  • Set(angle: number): void
  • Sets the 2x2 rotation matrix from the given angle. R(theta) = [ cos(theta) -sin(theta) ] [ sin(theta) cos(theta) ]

    Parameters

    • angle: number

      Matrix angle (theta).

    Returns void

SetIdentity

  • SetIdentity(): void
  • Sets the 2x2 matrix to identity.

    Returns void

SetM

  • Sets the 2x2 matrix from a 2x2 matrix.

    Parameters

    Returns void

SetVV

  • Sets the 2x2 matrix from 2 column vectors.

    Parameters

    Returns void

SetZero

  • SetZero(): void
  • Sets the 2x2 matrix to all zeros.

    Returns void

Solve

  • TODO, has something to do with the determinant

    Parameters

    • out: b2Vec2

      Solved vector

    • bX: number
    • bY: number

    Returns b2Vec2

    Solved vector

Static FromAngle

  • FromAngle(angle: number): b2Mat22
  • Creates a rotation 2x2 matrix from the given angle. R(theta) = [ cos(theta) -sin(theta) ] [ sin(theta) cos(theta) ]

    Parameters

    • angle: number

      Matrix angle (theta).

    Returns b2Mat22

    2x2 matrix.

Static FromVV

  • Creates a 2x2 matrix from two columns.

    Parameters

    Returns b2Mat22

    2x2 matrix.

Generated using TypeDoc