home *** CD-ROM | disk | FTP | other *** search
/ 3D Games (Spidla) / 3dhry1.iso / carterrain / src / trig.h < prev   
Encoding:
C/C++ Source or Header  |  2003-03-17  |  666 b   |  31 lines

  1. #ifndef _TRIG_H_
  2. #define _TRIG_H_
  3.  
  4. #ifndef PI
  5. #define PI    3.1415962814
  6. #endif
  7.  
  8. class CVector
  9. {
  10. public:
  11.     double x, y, z;
  12.     
  13.     CVector(void);
  14.     CVector(double x0, double y0, double z0);
  15.     ~CVector(void);
  16.     
  17.     CVector operator+(const CVector & b) const;
  18.     CVector operator-(const CVector & b) const;
  19.     CVector operator-() const;
  20.     CVector operator*(double n) const;
  21.     CVector operator/(double n) const;
  22.     double length(void) const;
  23.     double operator*(const CVector & b) const;
  24.     double operator^(const CVector & b) const;
  25.     CVector operator%(const CVector & b) const;
  26.     CVector unit(void) const;
  27. };
  28. CVector operator*(double n, const CVector & a);
  29.  
  30. #endif
  31.