C:/Projekte/C++/FlowVIS_107/src/vec3.h

Go to the documentation of this file.
00001 #ifndef VEC3_H
00002 #define VEC3_H
00003 
00004 #include "common.h"
00005 
00006 #include <iostream>
00007 #include <math.h>
00008 
00009 
00010 
00011 class vec3
00012 {
00013 public:
00015     float v[3];
00016     //constructors
00017     vec3();
00018         vec3(float x, float y, float z = 0.0f);
00019         vec3(const float* u);
00020         vec3(const vec3&);
00022         float& operator[](unsigned);
00024     vec3& operator=(const vec3&);
00025         
00026         //arithmetic assignments
00028         vec3& operator+=(const vec3&);
00030         vec3& operator-=(const vec3&);
00032     vec3& operator*=(float);
00034         vec3& operator/=(float);
00035         
00036         //arithmetic operations
00038         const vec3 operator+(const vec3&) const;
00040         const vec3 operator-(const vec3&) const;
00042         const vec3 operator*(float) const;
00044         const vec3 operator/(float) const;
00045 
00046         //boolean operators
00048         bool operator==(const vec3&) const;
00050         bool operator!=(const vec3&) const;
00051 
00053         vec3& operator-();
00055         float norm() const;
00057         float length() const;
00059         vec3& normalize();
00061         float dist2(const vec3&);
00063         float dist(const vec3&);
00065         float operator*(const vec3&) const;
00067         const vec3 operator^(const vec3&) const;
00068 
00070         void print();
00071 };
00072 
00074 std::ostream& operator<<(std::ostream&, const vec3&);
00075 
00076 #endif

Generated on Mon Jan 21 14:50:12 2008 for VisLU by  doxygen 1.5.4