FQuat2D

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

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/TransformCalculus2D.h

Include

#include "Math/TransformCalculus2D.h"

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

Public function

FQuat2D()

  1. initialize to an identity rotation.

Public function

FQuat2D

(
    float RotRadians
)

  1. initialize from a rotation in radians.

Public function

FQuat2D

(
    const FVector2D& InRot
)

Ctor.

Functions

Name Description

Public function Const

FQuat2D

 

Concatenate

(
    const FQuat2D& RHS
)

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

Public function Const

const FVecto...

 

GetVector()

Access to the underlying FVector2D that stores the complex number.

Public function Const

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

Public function Const

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

Public function Const

FVector2D

 

TransformVector

(
    const FVector2D& Vector
)

Vector rotation is equivalent to rotating a point.

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FQuat2D& Other
)

Inequality.

Public function Const

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.
Take our survey
Dismiss