Ctrl+K

Matrix2

Declaration

public struct Strawberry.Math.Matrix2

Constructors

Matrix2

Construct this matrix using columns.

void Matrix2(Vector2 c1, Vector2 c2)

Parameters:

Name Type Description
c1 Strawberry.Math.Vector2
c2 Strawberry.Math.Vector2

Matrix2

Construct this matrix using scalars.

void Matrix2(float a11, float a12, float a21, float a22)

Parameters:

Name Type Description
a11 System.Single
a12 System.Single
a21 System.Single
a22 System.Single

Matrix2

Construct this matrix using an angle. This matrix becomes an orthonormal rotation matrix.

void Matrix2(float angle)

Parameters:

Name Type Description
angle System.Single

Properties

Identity static

Matrix2 Identity { get }

Fields

Col1

Vector2 Col1

Col2

Vector2 Col2

Methods

Set

Initialize this matrix using columns.

void Set(Vector2 c1, Vector2 c2)

Parameters:

Name Type Description
c1 Strawberry.Math.Vector2
c2 Strawberry.Math.Vector2

Set

Initialize this matrix using an angle. This matrix becomes an orthonormal rotation matrix.

void Set(float angle)

Parameters:

Name Type Description
angle System.Single

SetIdentity

Set this to the identity matrix.

void SetIdentity()

SetZero

Set this matrix to all zeros.

void SetZero()

GetAngle

Extract the angle from this matrix (assumed to be a rotation matrix).

float GetAngle()

Invert

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

Matrix2 Invert()

Solve

Solve A * x = b, where b is a column vector. This is more efficient than computing the inverse in one-shot cases.

Vector2 Solve(Vector2 b)

Parameters:

Name Type Description
b Strawberry.Math.Vector2

Operators

op_Addition static

Matrix2 op_Addition(Matrix2 A, Matrix2 B)

Parameters:

Name Type Description
A Strawberry.Math.Matrix2
B Strawberry.Math.Matrix2