Vector.h

gehe zur Dokumentation dieser Datei
00001 #ifndef COORD3D_H_
00002 #define COORD3D_H_
00003 #include <cstdlib>
00004 #include <GL/glut.h>
00005 #include <iostream>
00006 #include <cmath>
00007 using std::cout;
00008 using std::ostream;
00009 
00010 #ifndef M_PI
00011 #define M_PI 3.14159265358979323846
00012 #endif
00013 
00014 #define vector new Vector
00015 #define color new Vector
00016 
00022 class Vector {
00023 public:
00027         double x;
00028 
00032         double y;
00033 
00037         double z;
00038 
00042         double w;
00043 
00047         static Vector e1;
00048 
00052         static Vector e2;
00053 
00057         static Vector e3;
00058 
00062         Vector(int a, int b = 0, int c = 0, int d = 1);
00063 
00067         Vector(double a = 0.0, double b = 0.0, double c = 0.0, double d = 1.0);
00068 
00072         friend ostream& operator<<(ostream& o, Vector& v);
00073 
00077         const double angle2dxz(const Vector& v);
00078 
00082         const Vector operator%(const Vector& v);
00083 
00087         const void operator*=(const GLfloat& v);
00088 
00092         const Vector operator*(const GLfloat& v);
00093 
00097         const Vector operator+(const Vector& v);
00098 
00102         const void operator+=(const Vector& v);
00103 
00107         const Vector operator-(const Vector& v);
00108 
00112         const void operator-=(const Vector& v);
00113 
00117         const double length() const;
00118 
00122         const double dot(const Vector& v);
00123 
00127         void norm();
00128 
00133         void set(int a, int b, int c, int d = 1);
00134 
00138         void set(double a, double b, double c, double d = 1.0);
00139 
00143         virtual ~Vector();
00144 };
00145 
00146 #define Color Vector
00147 
00148 #endif /*COORD3D_H_*/

Erzeugt am Sun Jun 10 13:47:51 2007 für Fishtank von  doxygen 1.5.2