Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

vector3D.h

Go to the documentation of this file.
00001 00003 00004 // / 00005 // Projet : Générateur de cylindres généralisés / 00006 // / 00007 // Nom du fichier : vector3D.h / 00008 // / 00009 // Creation : 20/11/2005 / 00010 // / 00011 // Description : La classe Vector3D permet de spécifier des vecteurs en 3D. / 00012 // / 00013 // Auteurs : - Guitteny Fabrice / 00014 // - Idiart Baptiste / 00015 // - Le Goff Erwan / 00016 // / 00018 00019 #ifndef VECTOR_3D_H 00020 #define VECTOR_3D_H 00021 00022 #include <stdio.h> 00023 #include <stdlib.h> 00024 #include <math.h> 00025 #include <iostream> 00026 #include "point.h" 00027 00035 00036 // Classe Vector3D // 00038 00039 class Vector3D { 00040 00046 friend std::ostream& operator<<(std::ostream &os,const Vector3D &vect); 00047 00053 friend Vector3D operator+(const Vector3D &v1,const Vector3D &v2); 00054 00060 friend Vector3D operator-(const Vector3D &v1,const Vector3D &v2); 00061 00067 friend Vector3D operator*(const Vector3D &v1,const double scalar); 00068 00074 friend Vector3D operator*(const double scalar, const Vector3D &v1); 00075 00076 00077 private: 00078 00080 double vect[3]; 00081 00082 00083 public: 00084 00088 Vector3D(const Vector3D &vector); 00089 00095 Vector3D(const double xx = 0, const double yy = 0, const double zz = 0); 00096 00101 Vector3D(const Point3D &p1, const Point3D &p2); 00102 00107 double operator[](int i) const; 00108 00113 double& operator[](int i); 00114 00118 double norm(); 00119 00123 Vector3D normalize(); 00124 00125 00130 double operator * (const Vector3D &vector); 00131 00136 Vector3D operator ^ (const Vector3D &vector); 00137 00142 Vector3D& operator*=(const double scalar); 00143 00148 Vector3D& operator+=(const Vector3D &vector); 00149 00154 Vector3D& operator-=(const Vector3D &vector); 00155 }; 00156 00157 std::ostream& operator<<(std::ostream&,const Vector3D&); 00158 Vector3D operator+(const Vector3D&,const Vector3D&); 00159 Vector3D operator-(const Vector3D&,const Vector3D&); 00160 Vector3D operator*(const double ,const Vector3D&); 00161 Vector3D operator*(const Vector3D&,const double); 00162 00163 #endif

Generated on Tue Nov 29 21:58:58 2005 for CylinderGenerator by doxygen 1.3.7