9 #ifndef TurtleBrains_Angle_hpp
10 #define TurtleBrains_Angle_hpp
12 #include <turtle_brains/core/tb_error.hpp>
13 #include <turtle_brains/math/tb_constants.hpp>
14 #include <turtle_brains/math/tb_math.hpp>
87 inline Type
AsRadians(
void)
const {
return mAngle; }
92 inline Type
AsDegrees(
void)
const {
return tbMath::Convert::RadiansToDegrees(mAngle); }
97 inline Type As(
const AngleUnit& angleUnits)
const
106 tb_error(
"Expected not to reach this point...");
117 mAngle = std::fmod(mAngle, tbMath::Pi<Type>());
141 return mAngle < other.mAngle;
144 bool operator<=(
const TypedAngle& other)
const
146 return mAngle <= other.mAngle;
151 return mAngle > other.mAngle;
154 bool operator>=(
const TypedAngle& other)
const
156 return mAngle >= other.mAngle;
181 TypedAngle operator*(
const Type& scalar)
const {
return Radians(mAngle * scalar); }
183 TypedAngle& operator*=(
const Type& scalar) { mAngle *= scalar;
return *
this; }
186 TypedAngle operator/(
const Type& scalar)
const {
return Radians(mAngle / scalar); }
188 TypedAngle& operator/=(
const Type& scalar) { mAngle /= scalar;
return *
this; }
205 output << angle.
AsDegrees() <<
" degrees";
Definition: tb_angle.hpp:38
TypedAngle operator-() const
Definition: tb_angle.hpp:171
static TypedAngle Radians(const Type angleInRadians)
Definition: tb_angle.hpp:51
TypedAngle(const Type &angle, const AngleUnit units)
Definition: tb_angle.hpp:79
Type AsRadians(void) const
Definition: tb_angle.hpp:87
bool operator==(const TypedAngle &other) const
Definition: tb_angle.hpp:124
void Normalize(void)
Definition: tb_angle.hpp:115
Type AsDegrees(void) const
Definition: tb_angle.hpp:92
static TypedAngle Degrees(const Type angleInDegrees)
Definition: tb_angle.hpp:43
TypedAngle(void)
Definition: tb_angle.hpp:66
bool operator!=(const TypedAngle &other) const
Definition: tb_angle.hpp:133
#define tb_error(message,...)
Definition: tb_error.hpp:23
Contains objects and functions for dealing with Vector and Matrix math.
std::ostream & operator<<(std::ostream &output, const tbMath::TypedAngle< Type > &angle)
Definition: tb_angle.hpp:203
bool IsEqual(const Type &leftValue, const Type &rightValue, const Type tolerance=tbMath::kTolerance)
Definition: tb_math.hpp:56
TypedAngle< float > Angle
Definition: tb_angle.hpp:198
AngleUnit
Definition: tb_angle.hpp:27
@ Radians
Specifies the angle input value is in units of Radians.
@ Degrees
Specifies the angle input value is in units of Degrees.
Here is some information about the primary namespace.
Definition: tb_application_dialog.hpp:22