return ret;
}
+ //! Zero Rotation (0 degrees)
static angle
zero()
{
return ret;
}
+ //! One Complete Rotation (360 degrees)
static angle
one()
{
angle ret;
- ret.v=PI;
+ ret.v=PI*2;
return ret;
}
+ //! One Half Rotation (180 degrees)
static angle
half()
{
angle ret;
- ret.v=PI*0.5;
+ ret.v=PI;
return ret;
}
- bool operator!()const { return v==0; }
+ bool operator!()const { return std::abs(mod().v) < epsilon; }
private:
cos(const angle &a):angle(a) { }
cos mod()const { return angle::mod(); }
cos dist(const angle &rhs)const { return angle::dist(rhs); }
- operator value_type()const ETL_DEPRECATED_FUNCTION;
#ifndef ETL_NO_DEPRECATED
- value_type get()const { return (value_type)std::cos(v); }
+ operator value_type()const ETL_DEPRECATED_FUNCTION;
#endif
+ value_type get()const { return (value_type)std::cos(v); }
}; // END of class angle::cos
inline angle::cos::operator angle::value_type()const { return get(); }