template<class T>
DualComplex class
Dual complex number.
Template parameters | |
---|---|
T | Underlying data type |
Contents
Represents 2D rotation and translation. See 2D and 3D transformations for brief introduction.
Base classes
-
template<class T>class Dual
- Dual number.
Public types
- using Type = T
- Underlying data type.
Public static functions
- static auto rotation(Rad<T> angle) -> DualComplex<T>
- Rotation dual complex number.
- static auto translation(const Vector2<T>& vector) -> DualComplex<T>
- Translation dual complex number.
- static auto fromMatrix(const Matrix3<T>& matrix) -> DualComplex<T>
- Create dual complex number from rotation matrix.
Constructors, destructors, conversion operators
- DualComplex(IdentityInitT = IdentityInit) constexpr noexcept
- Default constructor.
- DualComplex(ZeroInitT) explicit constexpr noexcept
- Construct zero-initialized dual complex number.
- DualComplex(NoInitT) explicit noexcept
- Construct without initializing the contents.
- DualComplex(const Complex<T>& real, const Complex<T>& dual = Complex<T>(T(0), T(0))) constexpr noexcept
- Construct dual complex number from real and dual part.
- DualComplex(const Vector2<T>& vector) explicit constexpr noexcept
- Construct dual complex number from vector.
-
template<class U>DualComplex(const DualComplex<U>& other) explicit constexpr noexcept
- Construct dual complex number from another of different type.
-
template<class U, class V = decltype(Implementation::DualComplexConverter<T, U>::from(std::DualComplex(const U& other) explicit constexpr
declval<U>()))> - Construct dual complex number from external representation.
- DualComplex(const Dual<Complex<T>>& other) constexpr noexcept
- Copy constructor.
-
template<class U, class V = decltype(Implementation::DualComplexConverter<T, U>::to(std::operator U() const explicit constexpr
declval<DualComplex<T>>()))> - Convert dual complex number to external representation.
Public functions
- auto isNormalized() const -> bool
- Whether the dual complex number is normalized.
- auto rotation() const -> Complex<T> constexpr
- Rotation part of dual complex number.
- auto translation() const -> Vector2<T>
- Translation part of dual complex number.
- auto toMatrix() const -> Matrix3<T>
- Convert dual complex number to transformation matrix.
- auto operator*(const DualComplex<T>& other) const -> DualComplex<T>
- Multipy with dual complex number.
- auto complexConjugated() const -> DualComplex<T>
- Complex-conjugated dual complex number.
- auto dualConjugated() const -> DualComplex<T>
- Dual-conjugated dual complex number.
- auto conjugated() const -> DualComplex<T>
- Conjugated dual complex number.
- auto lengthSquared() const -> T
- Complex number length squared.
- auto length() const -> T
- Dual quaternion length.
- auto normalized() const -> DualComplex<T>
- Normalized dual complex number (of unit length)
- auto inverted() const -> DualComplex<T>
- Inverted dual complex number.
- auto invertedNormalized() const -> DualComplex<T>
- Inverted normalized dual complex number.
- auto transformPoint(const Vector2<T>& vector) const -> Vector2<T>
- Rotate and translate point with dual complex number.
Function documentation
template<class T>
static DualComplex<T> Magnum:: Math:: DualComplex<T>:: rotation(Rad<T> angle)
Rotation dual complex number.
Parameters | |
---|---|
angle | Rotation angle (counterclockwise) |
template<class T>
static DualComplex<T> Magnum:: Math:: DualComplex<T>:: translation(const Vector2<T>& vector)
Translation dual complex number.
Parameters | |
---|---|
vector | Translation vector |
template<class T>
static DualComplex<T> Magnum:: Math:: DualComplex<T>:: fromMatrix(const Matrix3<T>& matrix)
Create dual complex number from rotation matrix.
Expects that the matrix represents rigid transformation.
template<class T>
Magnum:: Math:: DualComplex<T>:: DualComplex(IdentityInitT = IdentityInit) constexpr noexcept
Default constructor.
Creates unit dual complex number.
template<class T>
Magnum:: Math:: DualComplex<T>:: DualComplex(const Complex<T>& real,
const Complex<T>& dual = Complex<T>(T(0), T(0))) constexpr noexcept
Construct dual complex number from real and dual part.
template<class T>
Magnum:: Math:: DualComplex<T>:: DualComplex(const Vector2<T>& vector) explicit constexpr noexcept
Construct dual complex number from vector.
To be used in transformations later.
template<class T>
template<class U>
Magnum:: Math:: DualComplex<T>:: DualComplex(const DualComplex<U>& other) explicit constexpr noexcept
Construct dual complex number from another of different type.
Performs only default casting on the values, no rounding or anything else.
template<class T>
bool Magnum:: Math:: DualComplex<T>:: isNormalized() const
Whether the dual complex number is normalized.
Dual complex number is normalized if its real part has unit length:
template<class T>
Vector2<T> Magnum:: Math:: DualComplex<T>:: translation() const
Translation part of dual complex number.
template<class T>
DualComplex<T> Magnum:: Math:: DualComplex<T>:: operator*(const DualComplex<T>& other) const
Multipy with dual complex number.
template<class T>
DualComplex<T> Magnum:: Math:: DualComplex<T>:: complexConjugated() const
Complex-conjugated dual complex number.
template<class T>
DualComplex<T> Magnum:: Math:: DualComplex<T>:: dualConjugated() const
Dual-conjugated dual complex number.
template<class T>
DualComplex<T> Magnum:: Math:: DualComplex<T>:: conjugated() const
Conjugated dual complex number.
Both complex and dual conjugation.
template<class T>
T Magnum:: Math:: DualComplex<T>:: lengthSquared() const
Complex number length squared.
Should be used instead of length() for comparing complex number length with other values, because it doesn't compute the square root.
template<class T>
T Magnum:: Math:: DualComplex<T>:: length() const
Dual quaternion length.
See lengthSquared() which is faster for comparing length with other values.
template<class T>
DualComplex<T> Magnum:: Math:: DualComplex<T>:: normalized() const
Normalized dual complex number (of unit length)
template<class T>
DualComplex<T> Magnum:: Math:: DualComplex<T>:: inverted() const
Inverted dual complex number.
See invertedNormalized() which is faster for normalized dual complex numbers.
template<class T>
DualComplex<T> Magnum:: Math:: DualComplex<T>:: invertedNormalized() const
Inverted normalized dual complex number.
Expects that the complex number is normalized.
template<class T>
Vector2<T> Magnum:: Math:: DualComplex<T>:: transformPoint(const Vector2<T>& vector) const
Rotate and translate point with dual complex number.
template<class T>
template<class T>
Corrade:: Utility:: Debug& operator<<(Corrade:: Utility:: Debug& debug,
const DualComplex<T>& value)
Debug output operator.