Represents a 2D rotation as a complex number (analagous to quaternions). 更多...
#include <TransformCalculus2D.h>
Public 成员函数 | |
| FQuat2D | Concatenate (const FQuat2D &RHS) const |
| Transform 2 rotations defined by complex numbers: In imaginary land: (A + Bi) * (C + Di) == (AC - BD) + (AD + BC)i 更多... | |
| FQuat2D () | |
| Ctor. 更多... | |
| FQuat2D (const FVector2D &InRot) | |
| Ctor. 更多... | |
| FQuat2D (float RotRadians) | |
| Ctor. 更多... | |
| const FVector2D & | GetVector () const |
| Access to the underlying FVector2D that stores the complex number. | |
| FQuat2D | Inverse () const |
| 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 | |
| bool | operator!= (const FQuat2D &Other) const |
| Inequality. | |
| bool | operator== (const FQuat2D &Other) const |
| Equality. | |
| FVector2D | TransformPoint (const FVector2D &Point) const |
| 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) const |
| Vector rotation is equivalent to rotating a point. | |
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.
|
inline |
Ctor.
initialize to an identity rotation.
|
inlineexplicit |
Ctor.
initialize from a rotation in radians.
|
inlineexplicit |
Ctor.
initialize from an FVector2D, representing a complex number.
Transform 2 rotations defined by complex numbers: In imaginary land: (A + Bi) * (C + Di) == (AC - BD) + (AD + BC)i
Looking at this as a matrix, A == cos(theta), B == sin(theta), C == cos(sigma), D == sin(sigma):
[ A B] * [ C D] == [ AC-BD AD+BC] [-B A] [-D C] [-(AD+BC) AC-BD]
If you look at how the vector multiply works out: [X(AC-BD)+Y(-BC-AD) X(AD+BC)+Y(-BD+AC)] you can see it follows the same form of the imaginary form. Indeed, check out how the matrix nicely works out to [ A B] for a visual proof of the results. [-B A]
Transform a 2D point by the 2D complex number representing the rotation: In imaginary land: (x + yi) * (u + vi) == (xu - yv) + (xv + yu)i
Looking at this as a matrix, x == cos(A), y == sin(A)
[x y] * [ cosA sinA] == [x y] * [ u v] == [xu-yv xv+yu] [-sinA cosA] [-v u]
Looking at the above results, we see the equivalence with matrix multiplication.