base
|
#include <Angle.hpp>
Public Member Functions | |
Angle () | |
double | getRad () const |
double | getDeg () const |
bool | isApprox (Angle other, double prec=1e-5) const |
void | operator= (const Angle &other) |
bool | operator== (const Angle &other) const |
bool | operator< (const Angle &other) const |
bool | operator> (const Angle &other) const |
bool | operator<= (const Angle &other) const |
bool | operator>= (const Angle &other) const |
Angle & | operator+= (const Angle &other) |
Angle & | operator-= (const Angle &other) |
Angle | operator+ (const Angle &other) const |
Angle | operator- (const Angle &other) const |
Angle | operator* (const Angle &other) const |
Angle | operator* (const double &val) const |
Angle | flipped () const |
Angle & | flip () |
Static Public Member Functions | |
static double | rad2Deg (double rad) |
static double | deg2Rad (double deg) |
static double | normalizeRad (double rad) |
static Angle | fromRad (double rad) |
static Angle | fromDeg (double deg) |
static Angle | unknown () |
static Angle | Min () |
static Angle | Max () |
static Angle | vectorToVector (const base::Vector3d &a, const base::Vector3d &b) |
static Angle | vectorToVector (const base::Vector3d &a, const base::Vector3d &b, const base::Vector3d &positive) |
Public Attributes | |
double | rad |
Protected Member Functions | |
Angle (double _rad) | |
void | canonize () |
This class represents an angle, and can be used instead of double for convenience. The class has a canonical representation of the angle in degrees, in the interval PI < rad <= PI.
|
inline |
default constructor, which will initialize the value to unknown (NaN)
|
inlineexplicitprotected |
|
inlineprotected |
|
inlinestatic |
static conversion from degree to radians
deg | angle in degree |
|
inline |
Inverts the current angle
|
inline |
Returns a new angle which is the inverse of tis object.
|
inlinestatic |
use this method to get an angle from degrees.
deg | - angle in degrees. |
|
inlinestatic |
use this method to get an angle from radians.
rad | - angle in radians. |
|
inline |
|
inline |
|
inline |
compare two angles for approximate equality
other | - angle to compare |
prec | - precision interval in deg |
|
inlinestatic |
Returns the maximum angle possible after normalization
|
inlinestatic |
Returns the minimum angle possible after normalization
|
inlinestatic |
Normalize an angular value in [-pi; pi] and returns it as double
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
static conversion from radians to degree
rad | angle in radians |
|
inlinestatic |
Use this method to represent an unknown angle
|
static |
Computes the unsigned angle of the rotation that makes +a+ colinear with +b+
|
static |
Computes the angle of the rotation that makes +a+ colinear with +b+
Unlike vectorToVector(a, b), this method computes a signed angle, with the positive
vector defining the positive rotation direction. positive
is required to be of unit length.
double base::Angle::rad |
angle in radians. this value will always be PI < rad <= PI