103 return Vector2(r*u[0], r*u[1]) ;
111 return sqrt( _xyz[0]*_xyz[0] + _xyz[1]*_xyz[1] );
118 return _xyz[0]*_xyz[0] + _xyz[1]*_xyz[1] ;
125 return max(fabs(_xyz[0]),fabs(_xyz[1])) ;
133 out << u[0] <<
" " << u[1] ;
139 return Vector2(min(v1[0],v2[0]),min(v1[1],v2[1])) ;
144 return Vector2(max(v1[0],v2[0]),max(v1[1],v2[1])) ;
~Vector2()
Default destructor.
double norm() const
Norm.
double infNorm() const
Infinite norm.
Vector2()
Default constructor.
Vector2 operator*(double r, const Vector2 &u)
Left multiplication by a real value.
static Vector2 maxi(const Vector2 &, const Vector2 &)
static Vector2 mini(const Vector2 &, const Vector2 &)
std::ostream & operator<<(std::ostream &out, const Vector2 &u)
Out stream override: prints the 3 vector components.
double squareNorm() const
Square norm (self dot product)