Fixed a typo - the wrong method was marked as deprecated in angle::cos.
[synfig.git] / ETL / trunk / ETL / _angle.h
index 3080366..0b3461f 100644 (file)
@@ -60,7 +60,7 @@ public:
 protected:
        typedef value_type unit;
 
-       unit v; //! Stored in radians
+       unit v; //! Stored in radians; positive values indicate counter-clockwise.
 
 public:
 
@@ -128,22 +128,22 @@ public:
        }
 
        /*! Returns true if the shortest
-               angle between the left-hand and
-               right-hand side is clockwise */
+               angle from the left-hand to the
+               right-hand side is counter-clockwise */
        bool
        operator<(const angle &rhs)const
        { return dist(rhs).v<(value_type)0.0; }
 
        /*! Returns true if the shortest
-               angle between the left-hand and
-               right-hand side is counter-clockwise */
+               angle from the left-hand to the
+               right-hand side is clockwise */
        bool
        operator>(const angle &rhs)const
        { return dist(rhs).v>(value_type)0.0; }
 
        /*! Returns true if the shortest
-               angle between the left-hand and
-               right-hand side is clockwise,
+               angle from the left-hand to the
+               right-hand side is counter-clockwise,
                or if the angles are refer to the same
                point on the unit circle. */
        bool
@@ -151,8 +151,8 @@ public:
        { return dist(rhs).v<=(value_type)0.0; }
 
        /*! Returns true if the shortest
-               angle between the left-hand and
-               right-hand side is counter-clockwise,
+               angle from the left-hand to the
+               right-hand side is clockwise,
                or if the angles are refer to the same
                point on the unit circle. */
        bool
@@ -198,6 +198,7 @@ public:
                return ret;
        }
 
+       //! Zero Rotation (0 degrees)
        static angle
        zero()
        {
@@ -206,23 +207,25 @@ public:
                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:
 
@@ -363,10 +366,10 @@ public:
        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(); }