Go to the documentation of this file.
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]; }
79 inline void setX(
double r) {
_xyz[0] = r; }
80 inline void setY(
double r) {
_xyz[1] = r; }
102 _xyz[0] += v._xyz[0];
103 _xyz[1] += v._xyz[1];
109 _xyz[0] -= v._xyz[0];
110 _xyz[1] -= v._xyz[1];
132 return _xyz[0]*u._xyz[0] +
_xyz[1]*u._xyz[1] ;
137 return _xyz[0]*v._xyz[1] -
_xyz[1]*v._xyz[0] ;
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 squareNorm() const
Square norm (self dot product)
Vector2 & operator*=(double f)
~Vector2()
Default destructor.
Vector2 & operator/=(double f)
double infNorm() const
Infinite norm.
Vector2 & operator-=(const Vector2 &v)
double operator[](int i) const
friend std::ostream & operator<<(std::ostream &, const Vector2 &)
Out stream override: prints the 3 vector components.
friend Vector2 operator-(const Vector2 &)
static Vector2 mini(const Vector2 &, const Vector2 &)
Vector2()
Default constructor.
double operator*(const Vector2 &u) const
double operator^(const Vector2 &v) const
double _xyz[2]
The 3 vector components.
Vector2 operator+(const Vector2 &u) const
void setXY(double x, double y)
static Vector2 maxi(const Vector2 &, const Vector2 &)
Vector2 & operator+=(const Vector2 &v)
Vector2 operator/(double v)
Vector2 & operator=(const Vector2 &u)
friend bool operator==(const Vector2 &, const Vector2 &)
friend bool operator!=(const Vector2 &, const Vector2 &)
octovis
Author(s): Kai M. Wurm
, Armin Hornung
autogenerated on Thu Apr 3 2025 02:40:44