angle.h

Go to the documentation of this file.
00001 //
00002 // angle routines and classes
00003 // stuart meikle Wed Mar  8 15:45:13 2000
00004 //
00005 
00006 // beats messing around with angle calcs all the time!
00007 
00008 #ifndef ANGLE_H
00009 #define ANGLE_H
00010 
00011 #include <cmath>
00012 
00013 namespace mimas {
00014   
00020   class angle
00021     {
00022     private:
00025       double _angle;
00026   
00027       void arcTan2(double y, double x );
00028       void normalize(void);
00029     public:
00030 
00032       angle(void): _angle(0) {}
00036       angle( double aAngle ): _angle(aAngle) {}
00037 
00038       angle( double y, double x ) { arcTan2(y,x); }
00039   
00040       //this next is almost not an angle function , but it needs to live
00041       //within the namespace... DOESNT operate on 'this'
00042 
00043       //overload casting an angle to a double:
00044       operator double() const {return _angle;}
00045   
00046       //basic ops overloading:
00047       angle operator+( angle &a2 );
00048       angle operator-( angle &a2 );
00049       angle operator-(void) { return angle( -_angle ); }
00050       /* angle        operator+=(const angle& right);
00051    angle        operator+=(const double& right); */
00052       angle&        operator+=(const angle& right);
00053       angle&        operator+=(const double& right);
00054     };
00055     
00056 };
00057 
00058 #endif

[GNU/Linux] [Qt] [Mesa] [STL] [Lapack] [Boost] [Magick++] [Xalan-C and Xerces-C] [doxygen] [graphviz] [FFTW] [popt] [xine] [Gnuplot] [gnu-arch] [gcc] [gstreamer] [autoconf/automake/make] [freshmeat.net] [opensource.org] [sourceforge.net] [MMVL]
mimas 2.1 - Copyright Mon Oct 30 11:31:16 2006, Bala Amavasai, Stuart Meikle, Arul Selvan, Fabio Caparrelli, Jan Wedekind, Manuel Boissenin, ...