V_3D.cpp File Reference

#include <V_3D.h>

Include dependency graph for V_3D.cpp:

Go to the source code of this file.

Functions

V_3D operator+ (const V_3D &v1, const V_3D &v2)
V_3D operator- (const V_3D &v1, const V_3D &v2)
V_3D operator* (const double &alpha, const V_3D &v1)
V_3D operator* (const V_3D &v1, const double &alpha)
V_3D operator/ (const V_3D &v1, const double &alpha)
ostream & operator<< (ostream &flux, V_3D _v)
bool operator== (const V_3D &v1, const V_3D &v2)
bool operator!= (const V_3D &v1, const V_3D &v2)


Function Documentation

bool operator!= ( const V_3D v1,
const V_3D v2 
)

Definition at line 184 of file V_3D.cpp.

References V_3D::V.

00185 {
00186   double epsilon=0.0001;
00187   if(fabs(v1.V[0]-v2.V[0])>=epsilon
00188      || fabs(v1.V[1]-v2.V[1])>=epsilon
00189      || fabs(v1.V[2]-v2.V[2])>=epsilon)
00190     return true;
00191   else
00192     return false;
00193 }

V_3D operator* ( const V_3D v1,
const double &  alpha 
)

Definition at line 104 of file V_3D.cpp.

References V_3D::set(), and V_3D::V.

00105 {
00106   V_3D Z;
00107   int k_dim=0;
00108   for(k_dim=0;k_dim<3;k_dim++)
00109     Z.set(k_dim,alpha*v1.V[k_dim]);
00110   return Z;
00111 }

Here is the call graph for this function:

V_3D operator* ( const double &  alpha,
const V_3D v1 
)

Definition at line 95 of file V_3D.cpp.

References V_3D::set(), and V_3D::V.

00096 {
00097   V_3D Z;
00098   int k_dim=0;
00099   for(k_dim=0;k_dim<3;k_dim++)
00100     Z.set(k_dim,alpha*v1.V[k_dim]);
00101   return Z;
00102 }

Here is the call graph for this function:

V_3D operator+ ( const V_3D v1,
const V_3D v2 
)

Definition at line 77 of file V_3D.cpp.

References V_3D::set(), and V_3D::V.

00078 {
00079   V_3D Z;
00080   int k_dim=0;
00081   for(k_dim=0;k_dim<3;k_dim++)
00082     Z.set(k_dim,v1.V[k_dim]+v2.V[k_dim]);
00083   return Z;
00084 }

Here is the call graph for this function:

V_3D operator- ( const V_3D v1,
const V_3D v2 
)

Definition at line 86 of file V_3D.cpp.

References V_3D::set(), and V_3D::V.

00087 {
00088   V_3D Z;
00089   int k_dim=0;
00090   for(k_dim=0;k_dim<3;k_dim++)
00091     Z.set(k_dim,v1.V[k_dim]-v2.V[k_dim]);
00092   return Z;
00093 }

Here is the call graph for this function:

V_3D operator/ ( const V_3D v1,
const double &  alpha 
)

Definition at line 114 of file V_3D.cpp.

References V_3D::set(), and V_3D::V.

00115 {
00116   V_3D Z;
00117   int k_dim=0;
00118   for(k_dim=0;k_dim<3;k_dim++)
00119     Z.set(k_dim,v1.V[k_dim]/alpha);
00120   return Z;
00121 }

Here is the call graph for this function:

ostream& operator<< ( ostream &  flux,
V_3D  _v 
)

Definition at line 167 of file V_3D.cpp.

References V_3D::get().

00168 {
00169   flux<<"("<<_v.get(0)<<","<<_v.get(1)<<","<<_v.get(2)<<")";
00170   return flux;
00171 }

Here is the call graph for this function:

bool operator== ( const V_3D v1,
const V_3D v2 
)

Definition at line 173 of file V_3D.cpp.

References V_3D::V.

00174 {
00175   double epsilon=0.0001;
00176   if(fabs(v1.V[0]-v2.V[0])<epsilon
00177      && fabs(v1.V[1]-v2.V[1])<epsilon
00178      && fabs(v1.V[2]-v2.V[2])<epsilon)
00179     return true;
00180   else
00181     return false;
00182 }


Generated on Mon Mar 30 16:56:18 2009 by  doxygen 1.5.6