API Documentation
|
The primary angle storage class for this API. Stores an angle in an optimized format. More...
#include <Angle.h>
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 |
static constexpr fltp08 | INV_INDEX_PI = { 1.0 / Angle<t_type>::INDEX_PI } |
Protected Attributes | |
t_type | m_index_angle |
The primary angle storage class for this API. Stores an angle in an optimized format.
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.
|
inlineconstexpr |
Default constructor, creates an angle with 0 degrees.
Default copy constructor.
|
inlineexplicitconstexpr |
Explicit conversion of an angle from one container type to another.
Angle Constructor.
[in] | type | The type of the angle given (Example: radians, degrees, percent) |
[in] | value | The value of the angle in the units specified by type. |
Angle Constructor.
[in] | type | The type of the angle given (Example: radians, degrees, percent) |
[in] | value | The value of the angle in the units specified by type. |
|
inlineexplicitconstexpr |
Constructor.
[in] | value | the optimized input where INDEX_PI is 180 degrees |
|
inlinestatic |
Computes the principal value of the arc cosine of the given value.
[in] | value | - The value to perform arc cos. |
|
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) |
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). |
|
inlinestatic |
Computes the principal value of the arc sine of the given value.
[in] | value | - The value to perform arc sine. |
|
inlinestatic |
Computes the principal value of the arc tangent of the given value.
[in] | value | - The value to perform arc tangent. |
|
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 |
|
inlinenodiscardconstexpr |
Gets the internal index angle which is the default storage unit for the angle data.
|
inlinenodiscardconstexpr |
returns the normalized angle which lies from 0 to 360 degrees.
|
inlinenodiscardconstexpr |
returns the normalized angle which lies from -180 to 180 degrees.
|
inlineconstexpr |
Inequality operator.
[in] | angle | The value to check inequality against. |
|
inline |
negates the angle
[in] | angle | - The value to assign. |
|
inlineconstexpr |
Equality operator.
[in] | angle | - The value to check comparison. |
|
inlineconstexpr |
Explicit conversion of an angle from one container type to another.
|
staticconstexpr |
|
staticconstexpr |
|
protected |
The index angle.