|
MathLib
|
#include <math/Complex.hpp>
Public Types | |
Types | |
| using | value_type = T |
| The underlying implementation type. | |
Public Member Functions | |
| constexpr BasicComplex< T > | conjugate () const |
| BasicComplex< T > | pow (T exponent) const |
| Computes this BasicComplex raised to a real power. | |
| BasicComplex< T > | pow (int exponent) const |
| BasicComplex< T > | pow (BasicComplex< T > exponent) const |
| BasicComplex< T > | exp () const |
| BasicComplex< T > | log () const |
| BasicComplex< T > | log10 () const |
| T | normSquared () const |
| T | norm () const |
| T | magnitudeSquared () const |
| T | magnitude () const |
| constexpr BasicComplex< T > | normalized () const |
| BasicComplex< T > | inverse () const |
| BasicRadian< T > | angle () const |
| bool | isUnit () const |
| bool | isUnit (T tolerance) const |
| bool | isZero () const |
| bool | isZero (T tolerance) const |
| bool | isPure () const |
| constexpr std::complex< T > | asStdComplex () const |
Constructors | |
| constexpr | BasicComplex ()=default |
| constexpr | BasicComplex (T real_number) |
| Constructs a BasicComplex equivalent to the given real number. | |
| constexpr | BasicComplex (T real_part, T imaginary_part) |
| constexpr | BasicComplex (BasicRadian< T > real_part, BasicRadian< T > imaginary_part) |
| constexpr | BasicComplex (std::complex< T > c) |
| Conversion from std::complex. | |
Element Access | |
| constexpr const T & | real () const |
| constexpr void | real (T r) |
| constexpr const T & | i () const |
| constexpr void | i (T r) |
| constexpr const T & | imaginary () const |
| Extracts the imaginary part of a BasicComplex. | |
| constexpr void | imaginary (T r) |
Invalid Value Check | |
| bool | isNaN () const |
| bool | isInf () const |
Conversion Operators | |
| operator std::complex< T > () const | |
Static Public Member Functions | |
Constants | |
| static constexpr BasicComplex< T > | identity () |
| BasicComplex representation of the real number 1. | |
| static constexpr BasicComplex< T > | zero () |
| BasicComplex representation of the real number 0. | |
| static constexpr BasicComplex< T > | unit_real () |
| static constexpr BasicComplex< T > | unit_i () |
Convenience Creation Functions | |
| static constexpr BasicComplex< T > | make_pure (T i) |
| static constexpr BasicComplex< T > | encode_point (T x, T y) |
| static constexpr BasicComplex< T > | make_rotation (BasicRadian< T > radians) |
Friends | |
Equality | |
| constexpr bool | operator== (const BasicComplex< T > &left, const BasicComplex< T > &right) |
| template<std::floating_point OT = T> | |
| constexpr bool | approximately_equal_to (const BasicComplex< T > &value_to_test, const BasicComplex< T > &value_it_should_be, OT tolerance=OT{0.0002}) |
Operators | |
| constexpr BasicComplex< T > | operator* (const BasicComplex< T > &left, const BasicComplex< T > &right) |
| template<std::floating_point OT> | |
| constexpr BasicComplex< T > | operator* (const BasicComplex< T > &complex, OT scalar) |
| constexpr BasicComplex< T > | operator/ (const BasicComplex< T > &left, const BasicComplex< T > &right) |
| template<std::floating_point OT> | |
| constexpr BasicComplex< T > | operator/ (const BasicComplex< T > &complex, OT scalar) |
| constexpr BasicComplex< T > | operator+ (const BasicComplex< T > &left, const BasicComplex< T > &right) |
| template<std::floating_point OT> | |
| constexpr BasicComplex< T > | operator+ (const BasicComplex< T > &complex, OT scalar) |
| constexpr BasicComplex< T > | operator- (const BasicComplex< T > &left, const BasicComplex< T > &right) |
| template<std::floating_point OT> | |
| constexpr BasicComplex< T > | operator- (const BasicComplex< T > &complex, OT scalar) |
| constexpr BasicComplex< T > | operator- (const BasicComplex< T > &q) |
Check | |
| template<std::floating_point OT = T> | |
| bool | check_if_equal (const BasicComplex< T > &input, const BasicComplex< T > &near_to, OT tolerance=OT{0.0002}) |
| template<std::floating_point OT = T> | |
| bool | check_if_not_equal (const BasicComplex< T > &input, const BasicComplex< T > &near_to, OT tolerance=OT{0.0002}) |
Assert | |
| template<std::floating_point OT = T> | |
| void | CHECK_IF_EQUAL (const BasicComplex< T > &input, const BasicComplex< T > &near_to, OT tolerance=OT{0.0002}) |
| template<std::floating_point OT = T> | |
| void | CHECK_IF_NOT_EQUAL (const BasicComplex< T > &input, const BasicComplex< T > &near_to, OT tolerance=OT{0.0002}) |
| template<std::floating_point OT = T> | |
| void | CHECK_IF_ZERO (const BasicComplex< T > &input, OT tolerance=OT{0.0002}) |
Global Functions | |
| constexpr T | dot (const BasicComplex< T > &left, const BasicComplex< T > &right) |
| constexpr T | dot_normalized (const BasicComplex< T > &left, const BasicComplex< T > &right) |
| constexpr BasicComplex< T > | passively_rotate_encoded_point (const BasicComplex< T > &rotation, const BasicComplex< T > &encoded_point) |
| constexpr BasicComplex< T > | compose_rotations (const BasicComplex< T > &rotation_1, const BasicComplex< T > &rotation_2) |
| constexpr BasicComplex< T > | normalized (const BasicComplex< T > &input) |
| constexpr BasicRadian< T > | arg (const BasicComplex< T > &input) |
| constexpr BasicComplex< T > | polar (T m, BasicRadian< T > angle=BasicRadian< T >{}) |
| constexpr T | accumulate (const BasicComplex< T > &input) |
| constexpr BasicComplex< T > | slerp (const BasicComplex< T > &begin, const BasicComplex< T > &end, T percent) |
| std::string | format (const BasicComplex< T > &input) |
| constexpr BasicComplex< T > | conjugate (const BasicComplex< T > &input) |
| constexpr BasicComplex< T > | log (const BasicComplex< T > &input) |
| constexpr BasicComplex< T > | log10 (const BasicComplex< T > &input) |
| BasicComplex< T > | exp (const BasicComplex< T > &input) |
| BasicComplex< T > | pow (const BasicComplex< T > &input, T p) |
| BasicComplex< T > | pow (const BasicComplex< T > &input, int p) |
| BasicComplex< T > | pow (const BasicComplex< T > &input, const BasicComplex< T > &p) |
Trigonometric Functions | |
| BasicComplex< T > | sin (BasicComplex< T > c) |
| BasicComplex< T > | cos (BasicComplex< T > c) |
| BasicComplex< T > | tan (BasicComplex< T > c) |
| BasicComplex< T > | asin (BasicComplex< T > c) |
| BasicComplex< T > | acos (BasicComplex< T > c) |
| BasicComplex< T > | atan (BasicComplex< T > c) |
| BasicComplex< T > | sinh (BasicComplex< T > c) |
| BasicComplex< T > | cosh (BasicComplex< T > c) |
| BasicComplex< T > | tanh (BasicComplex< T > c) |
| BasicComplex< T > | asinh (BasicComplex< T > c) |
| BasicComplex< T > | acosh (BasicComplex< T > c) |
| BasicComplex< T > | atanh (BasicComplex< T > c) |
Related Symbols | |
(Note that these are not member symbols.) | |
Type Aliases | |
| using | Complexf = BasicComplex< float > |
| using | Complexd = BasicComplex< double > |
| using | Complex = BasicComplex< double > |
| using | Complexl = BasicComplex< long double > |
A mathematical complex number
Definition at line 31 of file Complex.hpp.
| using value_type = T |
The underlying implementation type.
Definition at line 37 of file Complex.hpp.
|
constexprdefault |
|
inlineconstexpr |
Constructs a BasicComplex equivalent to the given real number.
Definition at line 44 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 45 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 46 of file Complex.hpp.
|
inlineconstexpr |
Conversion from std::complex.
Definition at line 52 of file Complex.hpp.
|
inline |
Definition at line 135 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 206 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 67 of file Complex.hpp.
|
inlinestaticconstexpr |
Definition at line 191 of file Complex.hpp.
|
inline |
Computes the exponential form of this BasicComplex
Definition at line 97 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 146 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 147 of file Complex.hpp.
|
inlinestaticconstexpr |
BasicComplex representation of the real number 1.
Definition at line 59 of file Complex.hpp.
|
inlineconstexpr |
Extracts the imaginary part of a BasicComplex.
Definition at line 150 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 151 of file Complex.hpp.
|
inline |
Definition at line 133 of file Complex.hpp.
|
inline |
Definition at line 170 of file Complex.hpp.
|
inline |
Definition at line 166 of file Complex.hpp.
|
inline |
Definition at line 161 of file Complex.hpp.
|
inline |
Definition at line 154 of file Complex.hpp.
|
inline |
Definition at line 155 of file Complex.hpp.
|
inline |
Definition at line 157 of file Complex.hpp.
|
inline |
Definition at line 158 of file Complex.hpp.
|
inline |
Computes the log base e of this BasicComplex
Definition at line 107 of file Complex.hpp.
|
inline |
Computes the log base 10 of this BasicComplex
Definition at line 115 of file Complex.hpp.
|
inline |
Definition at line 124 of file Complex.hpp.
|
inline |
Definition at line 123 of file Complex.hpp.
|
inlinestaticconstexpr |
Construct a pure BasicComplex
| i | The value to set the imaginary component to |
i Definition at line 189 of file Complex.hpp.
|
inlinestaticconstexpr |
Enocde a rotation into a BasicComplex
| radians | The amount of rotation to apply (in radians) |
Definition at line 200 of file Complex.hpp.
|
inline |
Definition at line 121 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 126 of file Complex.hpp.
|
inline |
Definition at line 120 of file Complex.hpp.
|
inline |
Definition at line 211 of file Complex.hpp.
|
inline |
Definition at line 85 of file Complex.hpp.
|
inline |
Definition at line 80 of file Complex.hpp.
|
inline |
Computes this BasicComplex raised to a real power.
Definition at line 73 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 143 of file Complex.hpp.
|
inlineconstexpr |
Definition at line 144 of file Complex.hpp.
|
inlinestaticconstexpr |
Definition at line 64 of file Complex.hpp.
|
inlinestaticconstexpr |
Definition at line 63 of file Complex.hpp.
|
inlinestaticconstexpr |
BasicComplex representation of the real number 0.
Definition at line 62 of file Complex.hpp.
|
friend |
Sums up the components of input
| input | The BasicComplex to operate on |
Definition at line 542 of file Complex.hpp.
|
friend |
Definition at line 651 of file Complex.hpp.
|
friend |
Definition at line 681 of file Complex.hpp.
|
friend |
Compares two BasicComplex inputs equal, component-wise, to within a tolerance
| value_to_test | |
| value_it_should_be | |
| tolerance | How close they should be to be considered equal |
true if they are equalDefinition at line 247 of file Complex.hpp.
|
friend |
Computes the phase-angle (in radians of a Complex)
Definition at line 519 of file Complex.hpp.
|
friend |
Definition at line 646 of file Complex.hpp.
|
friend |
Definition at line 676 of file Complex.hpp.
|
friend |
Definition at line 656 of file Complex.hpp.
|
friend |
Definition at line 686 of file Complex.hpp.
|
friend |
Performs a concatenation of two rotations
| rotation_1 | The first rotation to perform |
| rotation_2 | The second rotation to perform |
Definition at line 498 of file Complex.hpp.
|
friend |
Computes the conjugate of the input
input.conjugate() Definition at line 573 of file Complex.hpp.
|
friend |
Definition at line 636 of file Complex.hpp.
|
friend |
Definition at line 666 of file Complex.hpp.
|
friend |
Calculates the dot product of two Quaternions
Definition at line 458 of file Complex.hpp.
|
friend |
Definition at line 464 of file Complex.hpp.
|
friend |
Computes the exponential of the input
input.exp() Definition at line 600 of file Complex.hpp.
|
friend |
Definition at line 564 of file Complex.hpp.
|
friend |
Computes the log of the input
input.log() Definition at line 582 of file Complex.hpp.
|
friend |
Computes the log base 10 of the input
input.log10() Definition at line 591 of file Complex.hpp.
|
friend |
Creates the normalized form of a Quaternion
| input | The Quaternion to normalize |
input Definition at line 510 of file Complex.hpp.
|
friend |
Defines equality of two Quaternions
Definition at line 231 of file Complex.hpp.
|
friend |
Rotates the encoded point using the given rotation
| rotation | The input rotation |
| encoded_point | The input point to be rotated |
rotation is a unit BasicComplex. encoded_point is an encoded_point Definition at line 485 of file Complex.hpp.
|
friend |
Constructs a unit Complex from the given axis and angle
| m | The magnitude of the Complex to create |
| angle | The amount of rotation to apply (in radians) |
Definition at line 531 of file Complex.hpp.
|
friend |
Definition at line 620 of file Complex.hpp.
|
friend |
Definition at line 615 of file Complex.hpp.
|
friend |
Computes the power of the input
input.exp() Definition at line 610 of file Complex.hpp.
|
friend |
Definition at line 631 of file Complex.hpp.
|
friend |
Definition at line 661 of file Complex.hpp.
|
friend |
Calculates the Spherical Linear Interpolation betwee two Complex numbers
| begin | Origin value |
| end | Destination value |
| percent | [0..1] Represents the percentage to interpolate |
Definition at line 553 of file Complex.hpp.
|
friend |
Definition at line 641 of file Complex.hpp.
|
friend |
Definition at line 671 of file Complex.hpp.