vec-vec.hpp File Reference

Go to the source code of this file.


vec operator+ (const vec &v1, const vec &v2)
vec operator- (const vec &v1, const vec &v2)
mat operator * (const vec &cv, const vec &rv)
double operator% (const vec &v1, const vec &v2)
vec operator/ (const vec &v1, const vec &v2)

Function Documentation

vec operator+ const vec v1,
const vec v2

vec+vec operator

Definition at line 49 of file vec-vec.hpp.

00050 {
00051   return vec(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z);
00052 }

vec operator- const vec v1,
const vec v2

vec-vec operator

Definition at line 56 of file vec-vec.hpp.

00057 {
00058   return vec(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z);
00059 }

mat operator * const vec cv,
const vec rv

vec*vec operator

Definition at line 63 of file vec-vec.hpp.

00064 {
00065   return mat( cv.x*rv.x, cv.x*rv.y, cv.x*rv.z,
00066               cv.y*rv.x, cv.y*rv.y, cv.y*rv.z,
00067               cv.z*rv.x, cv.z*rv.y, cv.z*rv.z );
00068 }

double operator% const vec v1,
const vec v2

vec%vec operator (inner product)

Definition at line 72 of file vec-vec.hpp.

00073 {
00074   return v1.x*v2.x +v1.y*v2.y +v1.z*v2.z;
00075 }

vec operator/ const vec v1,
const vec v2

vec/vec operator (outer product)

Definition at line 79 of file vec-vec.hpp.

00080 {
00081   return vec( v1.y*v2.z -v2.y*v1.z,
00082               v1.z*v2.x -v2.z*v1.x,
00083               v1.x*v2.y -v2.x*v1.y );
00084 }

Generated on Tue Mar 15 16:02:38 2005 for QVM by  doxygen 1.4.1