45 #ifndef _VRENDER_VECTOR2_H 46 #define _VRENDER_VECTOR2_H 77 inline double x()
const {
return _xyz[0]; }
78 inline double y()
const {
return _xyz[1]; }
149 double norm ()
const;
162 throw std::runtime_error(
"Out of bounds in Vector2::operator[]") ;
170 throw std::runtime_error(
"Out of bounds in Vector2::operator[]") ;
double operator^(const Vector2 &v) const
double operator[](int i) const
friend bool operator!=(const Vector2 &, const Vector2 &)
Vector2 & operator=(const Vector2 &u)
Vector2 operator-(const Vector2 &u) const
Vector2 & operator/=(double f)
friend Vector2 operator-(const Vector2 &)
~Vector2()
Default destructor.
Vector2 operator+(const Vector2 &u) const
double _xyz[2]
The 3 vector components.
Vector2 & operator-=(const Vector2 &v)
double norm() const
Norm.
double infNorm() const
Infinite norm.
Vector2()
Default constructor.
static Vector2 maxi(const Vector2 &, const Vector2 &)
static Vector2 mini(const Vector2 &, const Vector2 &)
Vector2 & operator+=(const Vector2 &v)
Vector2 operator/(double v)
double operator*(const Vector2 &u) const
friend bool operator==(const Vector2 &, const Vector2 &)
Vector2 & operator*=(double f)
double squareNorm() const
Square norm (self dot product)
void setXY(double x, double y)
friend std::ostream & operator<<(std::ostream &, const Vector2 &)
Out stream override: prints the 3 vector components.