63 explicit
Angle(
bool trim) noexcept
73 double Rad() const noexcept
94 double Deg() const noexcept
96 return rad_ * 180.0 / CVB_M_PI;
106 rad_ = deg* CVB_M_PI / 180.0;
140 return rad_ == angle.rad_;
151 return !(*
this == angle);
162 return rad_ < angle.rad_;
173 return (*
this == angle) || (*
this < angle);
184 return (*
this != angle) && !(*
this < angle);
196 return !(*
this < angle);
208 trim_ &= angle.trim_;
221 trim_ &= angle.trim_;
258 while (rad_ > CVB_M_PI)
259 rad_ -= CVB_M_PI * 2;
260 while (rad_ <= -CVB_M_PI)
261 rad_ += CVB_M_PI * 2;
420 return cos(angle.Rad());
433 return cosh(angle.Rad());
447 return sin(angle.Rad());
460 return sinh(angle.Rad());
473 return tan(angle.Rad());
486 return tanh(angle.Rad());
499 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:83
double Rad() const noexcept
Get the value in radians.
Definition: angle.hpp:73
bool operator>(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:182
Angle & operator-=(const Angle &angle) noexcept
Subtracts and assigns to this angle.
Definition: angle.hpp:218
Angle operator-(const Angle &lhs, const Angle &rhs)
Subtract two angles.
Definition: angle.hpp:294
double Cosh(Angle angle) noexcept
Returns the hyperbolic cosine of an angle.
Definition: angle.hpp:431
Angle & operator/=(const double &value) noexcept
Divides this angle by the given value.
Definition: angle.hpp:243
bool operator<=(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:171
double Deg() const noexcept
Get the value in degrees.
Definition: angle.hpp:94
bool operator!=(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:149
double Tanh(Angle angle) noexcept
Returns the hyperbolic tangent of an angle.
Definition: angle.hpp:484
bool operator<(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:160
void SetIsTrimmed(bool trim) noexcept
Set trimming of the value of the angle to the range -PI...PI.
Definition: angle.hpp:126
bool operator==(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:138
Angle operator*(const double &lhs, const Angle &rhs)
Multiplies value with an angle.
Definition: angle.hpp:336
double Sinh(Angle angle) noexcept
Returns the hyperbolic sine of an angle.
Definition: angle.hpp:458
Angle & operator+=(const Angle &angle) noexcept
Adds and assigns to this angle.
Definition: angle.hpp:205
Angle() noexcept=default
Generate a 0° angle.
double Sin(Angle angle) noexcept
Returns the sine of an angle.
Definition: angle.hpp:445
Angle operator*(const Angle &lhs, const double &rhs)
Multiplies an angle with a value.
Definition: angle.hpp:322
bool IsTrimmed() const noexcept
Get trimming of the angle's value to the range -PI...PI.
Definition: angle.hpp:116
Angle Atan2(double y, double x) noexcept
Returns the angle whose tangent is the quotient of two specified numbers.
Definition: angle.hpp:404
double Tan(Angle angle) noexcept
Returns the tangent of an angle.
Definition: angle.hpp:471
Angle Abs(Angle angle) noexcept
Absolute value of an angle.
Definition: angle.hpp:350
Angle operator+(const Angle &lhs, const Angle &rhs)
Add two angles.
Definition: angle.hpp:280
static Angle FromDegrees(double deg, bool trim=false) noexcept
Create an angle in degrees.
Definition: angle.hpp:30
double Cos(Angle angle) noexcept
Returns the cosine of an angle.
Definition: angle.hpp:418
Angle Acos(double d) noexcept
Returns the angle whose cosine is the specified number.
Definition: angle.hpp:363
Angle Asin(double d) noexcept
Returns the angle whose sine is the specified number.
Definition: angle.hpp:376
bool operator>=(const Angle &angle) const noexcept
Compares to an other angle.
Definition: angle.hpp:194
Angle Max(Angle a, Angle b) noexcept
Returns the bigger of two angles.
Definition: angle.hpp:511
int Sign(Angle angle) noexcept
Returns a value indicating the sign of an Angle.
Definition: angle.hpp:497
Angle Min(Angle a, Angle b) noexcept
Returns the smaller of two angles.
Definition: angle.hpp:528
Angle Atan(double d) noexcept
Returns the angle whose tangent is the specified number.
Definition: angle.hpp:389
void SetDeg(double deg) noexcept
Set the value in degrees.
Definition: angle.hpp:104
Angle & operator*=(const double &value) noexcept
Multiplies this angle with the given value.
Definition: angle.hpp:231
Angle operator/(const Angle &lhs, const double &rhs)
Divides an angle by a value.
Definition: angle.hpp:308
Root namespace for the Image Manager interface.
Definition: c_barcode.h:15