/*! ========================================================================
** Extended Template and Library
** Fast fastangle Abstraction Class Implementation
-** $Id: _fastangle.h,v 1.1.1.1 2005/01/04 01:31:47 darco Exp $
+** $Id$
**
** Copyright (c) 2002 Robert B. Quattlebaum Jr.
**
typedef fixed_base<ETL_FIXED_TYPE,ETL_FASTANGLE_LOOKUP_RES> unit;
unit v; //! Stored in rotations
-
+
public:
-
+
/*
** Arithmetic Operators
*/
ret.v=v/rhs;
return ret;
}
-
+
const fastangle &
operator+=(const fastangle &rhs)
{
ret.v=-v;
return ret;
}
-
+
//! 180 degree rotation operator
/*! Returns the fastangle directly opposite of
the given fastangle, and will yield a result
bool operator!()const { return v==unit(0); }
/*
- ** Converstion Classes
+ ** Conversion Classes
*/
class radians;
class rotations;
/*
- ** Trigometric Classes
+ ** Trigonometric Classes
*/
class sin;
class cos;
- class tan;
+ class tan;
/*
** Friend classes
else
v.data()=_fastangle_atan_table[(int)((x+1)*(value_type)((1<<(ETL_FASTANGLE_LOOKUP_RES-1))-1))];
}
-
+
tan(const value_type &y,const value_type &x)
{
if(x>=0 && y>=0) // First quadrant
return -delta;
return delta;
}
-
+
etl::fastangle cook(const etl::fastangle &x) { return x; }
etl::fastangle uncook(const etl::fastangle &x) { return x; }
};