56 explicit Angle(
bool trim =
false) noexcept
66 double Rad() const noexcept
87 double Deg() const noexcept
89 return rad_ * 180.0 / CVB_M_PI;
99 rad_ = deg* CVB_M_PI / 180.0;
133 return rad_ == angle.rad_;
144 return !(*
this == angle);
155 return rad_ < angle.rad_;
166 return (*
this == angle) || (*
this < angle);
177 return (*
this != angle) && !(*
this < angle);
189 return !(*
this < angle);
201 trim_ &= angle.trim_;
214 trim_ &= angle.trim_;
251 while (rad_ > CVB_M_PI)
252 rad_ -= CVB_M_PI * 2;
253 while (rad_ <= -CVB_M_PI)
254 rad_ += CVB_M_PI * 2;
413 return cos(angle.Rad());
426 return cosh(angle.Rad());
440 return sin(angle.Rad());
453 return sinh(angle.Rad());
466 return tan(angle.Rad());
479 return tanh(angle.Rad());
492 return ((0.0 < angle.Rad()) - (angle.Rad() < 0.0));
Object for convenient and type - safe handling of angles.
Definition: angle.hpp:19
static Angle FromRadians(double rad, bool trim=false) noexcept
Create an angle in radians.
Definition: angle.hpp:44
void SetRad(double rad) noexcept
Set the value in radians.
Definition: angle.hpp:76
double Rad() const noexcept
Get the value in radians.
Definition: angle.hpp:66
bool operator>(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:175
Angle & operator-=(const Angle &angle) noexcept
Subtracts and assigns to this angle.
Definition: angle.hpp:211
Angle operator-(const Angle &lhs, const Angle &rhs)
Subtract two angles.
Definition: angle.hpp:287
double Cosh(Angle angle) noexcept
Returns the hyperbolic cosine of an angle.
Definition: angle.hpp:424
Angle & operator/=(const double &value) noexcept
Divides this angle by the given value.
Definition: angle.hpp:236
bool operator<=(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:164
double Deg() const noexcept
Get the value in degrees.
Definition: angle.hpp:87
bool operator!=(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:142
double Tanh(Angle angle) noexcept
Returns the hyperbolic tangent of an angle.
Definition: angle.hpp:477
bool operator<(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:153
void SetIsTrimmed(bool trim) noexcept
Set trimming of the value of the angle to the range -PI...PI.
Definition: angle.hpp:119
bool operator==(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:131
Angle operator*(const double &lhs, const Angle &rhs)
Multiplies value with an angle.
Definition: angle.hpp:329
double Sinh(Angle angle) noexcept
Returns the hyperbolic sine of an angle.
Definition: angle.hpp:451
Angle & operator+=(const Angle &angle) noexcept
Adds and assigns to this angle.
Definition: angle.hpp:198
double Sin(Angle angle) noexcept
Returns the sine of an angle.
Definition: angle.hpp:438
Angle operator*(const Angle &lhs, const double &rhs)
Multiplies an angle with a value.
Definition: angle.hpp:315
bool IsTrimmed() const noexcept
Get trimming of the angle's value to the range -PI...PI.
Definition: angle.hpp:109
Angle Atan2(double y, double x) noexcept
Returns the angle whose tangent is the quotient of two specified numbers.
Definition: angle.hpp:397
double Tan(Angle angle) noexcept
Returns the tangent of an angle.
Definition: angle.hpp:464
Angle Abs(Angle angle) noexcept
Absolute value of an angle.
Definition: angle.hpp:343
Angle operator+(const Angle &lhs, const Angle &rhs)
Add two angles.
Definition: angle.hpp:273
static Angle FromDegrees(double deg, bool trim=false) noexcept
Create an angle in degrees.
Definition: angle.hpp:30
Angle(bool trim=false) noexcept
Generate a 0° angle.
Definition: angle.hpp:56
double Cos(Angle angle) noexcept
Returns the cosine of an angle.
Definition: angle.hpp:411
Angle Acos(double d) noexcept
Returns the angle whose cosine is the specified number.
Definition: angle.hpp:356
Angle Asin(double d) noexcept
Returns the angle whose sine is the specified number.
Definition: angle.hpp:369
bool operator>=(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:187
Angle Max(Angle a, Angle b) noexcept
Returns the bigger of two angles.
Definition: angle.hpp:504
int Sign(Angle angle) noexcept
Returns a value indicating the sign of an Angle.
Definition: angle.hpp:490
Angle Min(Angle a, Angle b) noexcept
Returns the smaller of two angles.
Definition: angle.hpp:521
Angle Atan(double d) noexcept
Returns the angle whose tangent is the specified number.
Definition: angle.hpp:382
void SetDeg(double deg) noexcept
Set the value in degrees.
Definition: angle.hpp:97
Angle & operator*=(const double &value) noexcept
Multiplies this angle with the given value.
Definition: angle.hpp:224
Angle operator/(const Angle &lhs, const double &rhs)
Divides an angle by a value.
Definition: angle.hpp:301
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24