Class radians

Inheritance Relationships

Base Type

Class Documentation

class radians : public rcppsw::er::stringizable

Used to store an angle value in radians (duh).

Public Functions

explicit radians(const degrees &d)
inline explicit radians(double value) noexcept
radians(void) = default
inline bool is_equal(const radians &other, double tol = kDOUBLE_EPSILON) const

Determine if two instances are equal within the specified tolerance.

This cannot be made part of operator==(), because those functions cannot have default arguments.

inline bool operator!=(const radians &other) const
inline radians operator*(double value) const
inline radians &operator*=(double value)
inline radians operator+(const radians &other) const
inline radians &operator+(void)
inline radians &operator+=(const radians &other)
inline radians operator-(const radians &other) const
inline radians operator-(void) const
inline radians &operator-=(const radians &other)
inline double operator/(const radians &other) const
inline radians operator/(double value) const
inline radians &operator/=(double value)
inline bool operator<(const radians &other) const
inline bool operator<=(const radians &other) const
inline bool operator==(const radians &other) const

Compare two radian values for equality, using the tolerance specified during construction.

inline bool operator>(const radians &other) const
inline bool operator>=(const radians &other) const
inline void set(double value)

Sets the value in radians.

inline radians &signed_normalize(void)

Normalizes the value in the range [-pi, pi].

virtual std::string to_str(void) const override

Return a string representation of the radians object of the form ‘rad(XX) -> deg(YY)’.

inline radians &unsigned_normalize(void)

Normalizes the value in the range [0, 2pi].

inline double v(void) const

Get the raw value in radians.

Public Static Attributes

static const radians kPI
static const radians kPI_OVER_FOUR
static const radians kPI_OVER_THREE
static const radians kPI_OVER_TWO
static const double kRADIANS_TO_DEGREES
static const radians kTHREE_PI_OVER_TWO
static const radians kTWO_PI
static const rmath::range<radians> kUNIT_CIRCLE
static const radians kZERO

Friends

inline friend std::istream &operator>>(std::istream &is, radians &r)