26 float to_float()
const {
32 Degrees operator*(
float scalar) {
33 return Degrees(to_float() * scalar);
36 Degrees& operator*=(
float scalar) {
42 bool operator<(T value)
const {
43 return value_ < value;
47 bool operator<=(T value)
const {
48 return value_ <= value;
52 bool operator>(T value)
const {
53 return value_ > value;
57 bool operator>=(T value)
const {
58 return value_ >= value;
61 bool operator<(
const Degrees& d)
const {
62 return value_ < d.value_;
65 bool operator<=(
const Degrees& d)
const {
66 return value_ <= d.value_;
69 bool operator>(
const Degrees& d)
const {
70 return value_ > d.value_;
73 bool operator>=(
const Degrees& d)
const {
74 return value_ >= d.value_;
79 ret.value_ = -ret.value_;
85 ret.value_ -= rhs.value_;
91 ret.value_ += rhs.value_;
95 bool operator==(
const Degrees& rhs)
const {
96 return value_ == rhs.value_;
99 bool operator!=(
const Degrees& rhs)
const {
100 return !(*
this == rhs);
103 bool is_effectively_equal_to(
const Degrees& rhs,
float epsilon=0.0f)
const {
105 float rhs_v = rhs.value_;
106 if(rhs_v < 0) rhs_v += 360.0f;
108 float lhs_v = value_;
109 if(lhs_v < 0) lhs_v += 360.0f;
111 return lhs_v - epsilon < rhs_v && lhs_v + epsilon > rhs_v;