FMatrix2x2

2x2 generalized matrix.

References

 Module Core Header /Engine/Source/Runtime/Core/Public/Math/TransformCalculus2D.h Include #include "Math/TransformCalculus2D.h"

Syntax

class FMatrix2x2

Remarks

2x2 generalized matrix. As FMatrix, we assume row vectors, row major storage: [X Y] * [m00 m01] [m10 m11]

Constructors

Name Description

FMatrix2x2()

1. initialize to an identity.

FMatrix2x2

(
float UniformScale
)

1. initialize from a scale.

FMatrix2x2

(
const FScale2D& Scale
)

1. initialize from a scale.

FMatrix2x2

(
const FShear2D& Shear
)

Factory function. initialize from a 2D shear.

FMatrix2x2

(
const FQuat2D& Rotation
)

1. initialize from a rotation.

FMatrix2x2

(
float m00,
float m01,
float m10,
float m11
)

Functions

Name Description

FMatrix2x2

Concatenate

(
const FMatrix2x2& RHS
)

Concatenate 2 matrices: [A B] * [E F] == [AE+BG AF+BH] [C D] [G H] [CE+DG CF+DH]

float

Determinant()

void

GetMatrix

(
float& A,
float& B,
float& C,
float& D
)

float

GetRotationAngle()

Gets the rotation angle of the matrix.

FScale2D

GetScale()

Gets the scale from the matrix.

FScale2D

GetScaleSquared()

Extracts the squared scale from the matrix (avoids sqrt).

FMatrix2x2

Inverse()

Invert the transform.

float

InverseDeterminant()

bool

IsIdentity()

Determines if the matrix is identity or not.

bool

IsNearlyIdentity

(
float ErrorTolerance
)

FVector2D

TransformPoint

(
const FVector2D& Point
)

Transform a 2D point [X Y] * [m00 m01] [m10 m11]

FVector2D

TransformVector

(
const FVector2D& Vector
)

Vector transformation is equivalent to point transformation as our matrix is not homogeneous.

Operators

Name Description

bool

operator!=

(
const FMatrix2x2& Other
)

Inequality.

bool

operator==

(
const FMatrix2x2& RHS
)

Equality.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.