33#include <NDEVR/BaseValues.h>
34#include <NDEVR/ObjectInfo.h>
83 template<
class t_
float_type>
84 static constexpr t_float_type PI()
95 template<
class t_type = fltp08>
117 template<
class t_other_type>
162 constexpr explicit Angle(t_type value)
172 template<AngleType t_angle_type>
175 switch (t_angle_type)
214 template<
bool t_normalized>
217 if constexpr(t_normalized)
229 template<
class t_new_type>
297 template<
class t_value_type>
308 template<
class t_value_type>
319 template<
class t_value_type>
331 template<
class t_value_type>
340 template<
class t_normal_type>
341 static constexpr typename std::enable_if<!ObjectInfo<t_normal_type>::Float, t_normal_type>::type NormalizeInternal(t_normal_type value)
343 const t_normal_type angle = (value >= 0 ? value : -value) % (2 *
INDEX_PI);
350 template<
class t_normal_type>
351 static constexpr typename std::enable_if<ObjectInfo<t_normal_type>::Float, t_normal_type>::type NormalizeInternal(t_normal_type value)
353 const t_normal_type angle = fmod(std::abs(value), (2 *
INDEX_PI));
372 template<
class t_type>
375 return IsInvalid(value.template internal<false>());
378 template<
class t_to,
class t_from>
387 struct ObjectInfo<Angle<
sint04>, false, false>
389 static const uint01 Dimensions = 0;
390 static const bool Vector =
false;
391 static const bool Primitive =
true;
392 static const bool Pointer =
false;
393 static const bool Unsigned =
false;
394 static const bool Float =
true;
395 static const bool Integer =
false;
396 static const bool Number =
true;
397 static const bool String =
false;
398 static const bool Color =
false;
399 static const bool Buffer =
false;
400 static const bool Boolean =
false;
401 static constexpr ObjectInfo<Angle<sint04>,
false,
false> VectorSub() {
return ObjectInfo<Angle<sint04>,
false,
false>(); }
407 struct ObjectInfo<Angle<
fltp08>, false, false>
409 static const uint01 Dimensions = 0;
410 static const bool Vector =
false;
411 static const bool Primitive =
true;
412 static const bool Pointer =
false;
413 static const bool Unsigned =
false;
414 static const bool Float =
true;
415 static const bool Integer =
false;
416 static const bool Number =
true;
417 static const bool String =
false;
418 static const bool Color =
false;
419 static const bool Buffer =
false;
420 static const bool Boolean =
false;
421 static constexpr ObjectInfo<Angle<fltp08>,
false,
false> VectorSub() {
return ObjectInfo<Angle<fltp08>,
false,
false>(); }
427 struct ObjectInfo<Angle<
fltp04>, false, false>
429 static const uint01 Dimensions = 0;
430 static const bool Vector =
false;
431 static const bool Primitive =
true;
432 static const bool Pointer =
false;
433 static const bool Unsigned =
false;
434 static const bool Float =
true;
435 static const bool Integer =
false;
436 static const bool Number =
true;
437 static const bool String =
false;
438 static const bool Color =
false;
439 static const bool Buffer =
false;
440 static const bool Boolean =
false;
441 static constexpr ObjectInfo<Angle<fltp04>,
false,
false> VectorSub() {
return ObjectInfo<Angle<fltp04>,
false,
false>(); }
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:408
t_type m_index_angle
Definition Angle.h:362
static Angle asin(t_value_type value)
Computes the principal value of the arc sine of the given value.
Definition Angle.h:309
constexpr t_type internal() const
Gets the internal index angle which is the default storage unit for the angle data.
Definition Angle.h:215
constexpr Angle(AngleType type, fltp04 value)
Angle Constructor.
Definition Angle.h:127
constexpr Angle< t_new_type > toTypeAngle() const
Explicit conversion of an angle from one container type to another.
Definition Angle.h:230
constexpr Angle normalizedOffset() const
returns the normalized angle which lies from -180 to 180 degrees.
Definition Angle.h:245
constexpr Angle()
Default constructor, creates an angle with 0 degrees.
Definition Angle.h:103
constexpr Angle(const Angle &angle)
Default copy constructor.
Definition Angle.h:110
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)
Definition Angle.h:332
constexpr Angle normalized() const
returns the normalized angle which lies from 0 to 360 degrees.
Definition Angle.h:238
constexpr Angle & operator=(const Angle &angle)
Definition Angle.h:256
constexpr Angle(const Angle< t_other_type > &angle)
Explicit conversion of an angle from one container type to another.
Definition Angle.h:118
static constexpr fltp08 INV_INDEX_PI
Definition Angle.h:338
static Angle acos(t_value_type value)
Computes the principal value of the arc cosine of the given value.
Definition Angle.h:298
Angle operator-() const
negates the angle
Definition Angle.h:286
constexpr bool operator!=(const Angle &angle) const
Inequality operator.
Definition Angle.h:277
constexpr fltp08 as(AngleType type) const
Returns a form of this angle as a given type (Radian, Degree, Percent, etc)
Definition Angle.h:197
static Angle atan(t_value_type value)
Computes the principal value of the arc tangent of the given value.
Definition Angle.h:320
constexpr bool operator==(const Angle &angle) const
Equality operator.
Definition Angle.h:267
constexpr Angle(AngleType type, fltp08 value)
Angle Constructor.
Definition Angle.h:145
static constexpr sint04 INDEX_PI
Definition Angle.h:337
constexpr Angle(t_type value)
Constructor.
Definition Angle.h:162
constexpr fltp08 as() const
Returns a form of this angle as a given type (Radian, Degree, Percent, etc)
Definition Angle.h:173
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:62
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:125
EulerPosition
Values that represent euler angles.
Definition Angle.h:46
@ ROLL
Definition Angle.h:47
@ YAW
Definition Angle.h:49
@ PITCH
Definition Angle.h:48
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:78
AngleType
The possible units that can be used by the angle class.
Definition Angle.h:60
@ PERCENT
Definition Angle.h:64
@ RADIANS
Definition Angle.h:61
@ DEGREES
Definition Angle.h:62
@ INTERNAL_ANGLE
Definition Angle.h:63
AngleFormatMode
Values that represent angle format modes.
Definition Angle.h:72
@ MODE_DEGREES_MINUTES_SECONDS
Definition Angle.h:74
@ MODE_GRADIANS
Definition Angle.h:75
@ MODE_RADIANS
Definition Angle.h:76
@ MODE_SURVEYOR_UNITS
Definition Angle.h:77
@ MODE_DECIMAL_DEGREES
Definition Angle.h:73
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:379
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:146
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved.
Definition BaseValues.hpp:230