45 #ifndef _VRENDER_VECTOR3_H 46 #define _VRENDER_VECTOR3_H 51 # define FLT_MAX 9.99E20f 74 Vector3 (
double,
double,
double);
81 inline double x()
const {
return _xyz[0]; }
82 inline double y()
const {
return _xyz[1]; }
83 inline double z()
const {
return _xyz[2]; }
164 double norm ()
const;
177 throw std::runtime_error(
"Out of bounds in Vector3::operator[]") ;
185 throw std::runtime_error(
"Out of bounds in Vector3::operator[]") ;
double squareNorm() const
Square norm (self dot product)
Vector3 operator^(const Vector3 &v) const
Vector3 operator-(const Vector3 &u) const
Vector3 operator+(const Vector3 &u) const
Vector3 & operator-=(const Vector3 &v)
void setXYZ(double x, double y, double z)
static Vector3 maxi(const Vector3 &, const Vector3 &)
Vector3 & operator/=(double f)
friend bool operator==(const Vector3 &, const Vector3 &)
static Vector3 mini(const Vector3 &, const Vector3 &)
friend bool operator!=(const Vector3 &, const Vector3 &)
double infNorm() const
Infinite norm.
friend std::ostream & operator<<(std::ostream &, const Vector3 &)
double operator[](int i) const
Vector3 & operator=(const Vector3 &u)
~Vector3()
Default destructor.
double _xyz[3]
The 3 vector components.
Vector3 & operator*=(double f)
Vector3 operator/(double v)
double operator*(const Vector3 &u) const
friend Vector3 operator-(const Vector3 &u)
Vector3 & operator+=(const Vector3 &v)
double norm() const
Norm.