 # FQuat2D

## Represents a 2D rotation as a complex number (analagous to quaternions).

References

Syntax

class FQuat2D

Remarks

Represents a 2D rotation as a complex number (analagous to quaternions). Rot(theta) == cos(theta) + i * sin(theta) General transformation follows complex number algebra from there. Does not use "spinor" notation using theta/2 as we don't need that decomposition for our purposes. This makes the implementation for straightforward and efficient for 2D.

Constructors

Name Description

FQuat2D()

1. initialize to an identity rotation.

FQuat2D

(
)

1. initialize from a rotation in radians.

FQuat2D

(
const FVector2D& InRot
)

Ctor.

Functions

Name Description

FQuat2D

Concatenate

(
const FQuat2D& RHS
)

Transform 2 rotations defined by complex numbers: In imaginary land: (A + Bi) * (C + Di) == (AC - BD) + (AD + BC)i

const FVecto...

GetVector()

FQuat2D

Inverse()

Invert the rotation defined by complex numbers: In imaginary land, an inverse is a complex conjugate, which is equivalent to reflecting about the X axis: Conj(A + Bi) == A - Bi

FVector2D

TransformPoint

(
const FVector2D& Point
)

Transform a 2D point by the 2D complex number representing the rotation: In imaginary land: (x + yi) * (u + vi) == (xu - yv) + (xv + yu)i

FVector2D

TransformVector

(
const FVector2D& Vector
)

Vector rotation is equivalent to rotating a point.

Operators

Name Description

bool

operator!=

(
const FQuat2D& Other
)

Inequality.

bool

operator==

(
const FQuat2D& Other
)

Equality.

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