From a6a8bd0374c02c8b6f4912ab1c71b22c47ecd677 Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 28 Sep 2007 02:07:26 +0000 Subject: [PATCH] The angle comparison code was considering 90+359 degrees to be greater than 90 degrees. The comments claim otherwise. Fix the code to correspond with the comments. Similarly for <, >=, and <=. git-svn-id: http://svn.voria.com/code@784 1f10aa63-cdf2-0310-b900-c93c546f37ac --- ETL/trunk/ETL/_angle.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/ETL/trunk/ETL/_angle.h b/ETL/trunk/ETL/_angle.h index ae3b157..34bc9f5 100644 --- a/ETL/trunk/ETL/_angle.h +++ b/ETL/trunk/ETL/_angle.h @@ -1,3 +1,4 @@ +#include /* ======================================================================== ** Extended Template and Library ** Angle Abstraction Class Implementation @@ -131,16 +132,14 @@ public: right-hand side is clockwise */ bool operator<(const angle &rhs)const - { return v(const angle &rhs)const - { return v>rhs.v; } -// { return dist(rhs).v>(value_type)0.0; } + { return dist(rhs).v>(value_type)0.0; } /*! Returns true if the shortest angle between the left-hand and @@ -149,8 +148,7 @@ public: point on the unit circle. */ bool operator<=(const angle &rhs)const - { return v<=rhs.v; } -// { return dist(rhs).v<=(value_type)0.0; } + { return dist(rhs).v<=(value_type)0.0; } /*! Returns true if the shortest angle between the left-hand and @@ -159,24 +157,21 @@ public: point on the unit circle. */ bool operator>=(const angle &rhs)const - { return v>=rhs.v; } -// { return dist(rhs).v>=(value_type)0.0; } + { return dist(rhs).v>=(value_type)0.0; } /*! Returns true if the angles are refer to the same point on the unit circle. */ bool operator==(const angle &rhs)const - { return v==rhs.v; } -// { return dist(rhs).v==(value_type)0.0; } + { return dist(rhs).v==(value_type)0.0; } /*! Returns false if the angles are refer to the same point on the unit circle. */ bool operator!=(const angle &rhs)const - { return v!=rhs.v; } -// { return dist(rhs).v!=(value_type)0.0; } + { return dist(rhs).v!=(value_type)0.0; } //! Angle Difference Function /*! This function will return the -- 2.7.4