![]() |
NDEVR
API Documentation
|
Stores an angle in an optimized internal format with support for efficient trigonometric operations. More...
Public Member Functions | |
| constexpr | Angle () |
| Default constructor, creates an angle with 0 degrees. | |
| constexpr | Angle (AngleType type, fltp04 value) |
| Angle Constructor. | |
| constexpr | Angle (AngleType type, fltp08 value) |
| Angle Constructor. | |
| constexpr | Angle (const Angle &angle) |
| Default copy constructor. | |
| template<class t_other_type> | |
| constexpr | Angle (const Angle< t_other_type > &angle) |
| Explicit conversion of an angle from one container type to another. | |
| constexpr | Angle (t_type value) |
| Constructor. | |
| template<AngleType t_angle_type> | |
| constexpr fltp08 | as () const |
| Returns a form of this angle as a given type (Radian, Degree, Percent, etc) The template t_type provides the AngleType of the angle to return (Example: radians, degrees, percent). | |
| constexpr fltp08 | as (AngleType type) const |
| Returns a form of this angle as a given type (Radian, Degree, Percent, etc). | |
| template<bool t_normalized> | |
| constexpr t_type | internal () const |
| Gets the internal index angle which is the default storage unit for the angle data. | |
| constexpr Angle | normalized () const |
| returns the normalized angle which lies from 0 to 360 degrees. | |
| constexpr Angle | normalizedOffset () const |
| returns the normalized angle which lies from -180 to 180 degrees. | |
| constexpr bool | operator!= (const Angle &angle) const |
| Inequality operator. | |
| Angle | operator- () const |
| negates the angle | |
| constexpr Angle & | operator= (const Angle &angle) |
| constexpr bool | operator== (const Angle &angle) const |
| Equality operator. | |
| template<class t_new_type> | |
| constexpr Angle< t_new_type > | toTypeAngle () const |
| Explicit conversion of an angle from one container type to another. | |
Static Public Member Functions | |
| template<class t_value_type> | |
| static Angle | acos (t_value_type value) |
| Computes the principal value of the arc cosine of the given value. | |
| template<class t_value_type> | |
| static Angle | asin (t_value_type value) |
| Computes the principal value of the arc sine of the given value. | |
| template<class t_value_type> | |
| static Angle | atan (t_value_type value) |
| Computes the principal value of the arc tangent of the given value. | |
| template<class t_value_type> | |
| static Angle | atan2 (t_value_type x, t_value_type y) |
| measures the counterclockwise angle between the positive x-axis and the point (x, y) | |
Static Public Attributes | |
| static constexpr sint04 | INDEX_PI = 32768 |
| Optimized angle constant representing PI; allows integers to store angles to some degree of accuracy. | |
| static constexpr fltp08 | INV_INDEX_PI = { 1.0 / Angle<t_type>::INDEX_PI } |
| Precomputed inverse of INDEX_PI used for converting internal angles to other representations. | |
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
Since all angles are from 0-360 degrees it is possible to make certain optimizations that make use of defined overflow that traditional floating point angles would not be able to achieve. In addition space can be saved and expensive sin, cos, tan functions can be precomputed.
|
inlineexplicitconstexpr |
|
inlinestatic |
Computes the principal value of the arc cosine of the given value.
| [in] | value | - The value to perform arc cos. |
Definition at line 266 of file Angle.h.
References Angle(), acos(), and RADIANS.
Referenced by acos(), and AngleDefinitions::AngleBetween().
|
inlinenodiscardconstexpr |
Returns a form of this angle as a given type (Radian, Degree, Percent, etc) The template t_type provides the AngleType of the angle to return (Example: radians, degrees, percent).
| [in] | t_is_signed | Whether the given type should be signed or not (-180 - 180 vs 0 to 360) |
Definition at line 141 of file Angle.h.
References as(), cast(), DEGREES, internal(), INTERNAL_ANGLE, INV_INDEX_PI, IsInvalid(), PERCENT, PI(), and RADIANS.
|
inlinenodiscardconstexpr |
Returns a form of this angle as a given type (Radian, Degree, Percent, etc).
| [in] | type | - The AngleType of the angle to return (Example: radians, degrees, percent). |
Definition at line 165 of file Angle.h.
References as(), DEGREES, INTERNAL_ANGLE, PERCENT, RADIANS, and type.
|
inlinestatic |
Computes the principal value of the arc sine of the given value.
| [in] | value | - The value to perform arc sine. |
Definition at line 277 of file Angle.h.
References Angle(), asin(), and RADIANS.
Referenced by asin(), and XRFunctions::ConvertFromQuaternion().
|
inlinestatic |
Computes the principal value of the arc tangent of the given value.
| [in] | value | - The value to perform arc tangent. |
Definition at line 288 of file Angle.h.
References Angle(), atan(), and RADIANS.
Referenced by atan(), and AngleDefinitions::Inclination().
|
inlinestatic |
measures the counterclockwise angle between the positive x-axis and the point (x, y)
| [in] | x | - the numerator or x value of atan |
| [in] | y | - the denomenator or y value of atan |
Definition at line 300 of file Angle.h.
References Angle(), atan2(), and RADIANS.
Referenced by atan2(), XRFunctions::ConvertFromQuaternion(), AngleDefinitions::Heading(), and AngleDefinitions::Inclination().
|
inlinenodiscardconstexpr |
Gets the internal index angle which is the default storage unit for the angle data.
Definition at line 183 of file Angle.h.
References Angle().
Referenced by Angle(), as(), normalized(), operator!=(), operator==(), LineEditResourceSetter< Angle< fltp08 >, ObjectInfo< Angle< fltp08 > >::Number >::ValueToFloat(), and LineEditResourceSetter< Angle< sint04 >, ObjectInfo< Angle< sint04 > >::Number >::ValueToFloat().
|
inlineconstexpr |
Inequality operator.
| [in] | angle | The value to check inequality against. |
Definition at line 245 of file Angle.h.
References Angle(), and internal().
|
inlineconstexpr |
Equality operator.
| [in] | angle | - The value to check comparison. |
Definition at line 235 of file Angle.h.
References Angle(), and internal().