Vector2d Class Reference

Generic double x, y vector. More...

#include <Vector2d.hh>

Public Member Functions

 Vector2d ()
 Constructor. More...
 
 Vector2d (const double &_x, const double &_y)
 Constructor. More...
 
 Vector2d (const Vector2d &_v)
 Copy constructor. More...
 
 Vector2d (const ignition::math::Vector2d &_v)
 Copy constructor for ignition math. More...
 
virtual ~Vector2d ()
 Destructor. More...
 
double Distance (const Vector2d &_pt) const
 Calc distance to the given point. More...
 
double Dot (const Vector2d &_v) const
 Return the dot product of this vector and _v. More...
 
ignition::math::Vector2d Ign () const
 Convert this vector to an ignition::math::Vector2d. More...
 
bool IsFinite () const
 See if a point is finite (e.g., not nan) More...
 
void Normalize ()
 Normalize the vector length. More...
 
bool operator!= (const Vector2d &_v) const
 Not equal to operator. More...
 
const Vector2d operator* (const Vector2d &_v) const
 Multiplication operators. More...
 
const Vector2d operator* (double _v) const
 Multiplication operators. More...
 
const Vector2doperator*= (const Vector2d &_v)
 Multiplication assignment operator. More...
 
const Vector2doperator*= (double _v)
 Multiplication assignment operator. More...
 
Vector2d operator+ (const Vector2d &_v) const
 Addition operator. More...
 
const Vector2doperator+= (const Vector2d &_v)
 Addition assignment operator. More...
 
Vector2d operator- (const Vector2d &_v) const
 Subtraction operator. More...
 
const Vector2doperator-= (const Vector2d &_v)
 Subtraction assignment operator. More...
 
const Vector2d operator/ (const Vector2d &_v) const
 Division operator. More...
 
const Vector2d operator/ (double _v) const
 Division operator. More...
 
const Vector2doperator/= (const Vector2d &_v)
 Division operator. More...
 
const Vector2doperator/= (double _v)
 Division operator. More...
 
Vector2doperator= (const Vector2d &_v)
 Assignment operator. More...
 
Vector2doperator= (const ignition::math::Vector2d &_v)
 Assignment operator for ignition math. More...
 
const Vector2doperator= (double _v)
 Assignment operator. More...
 
bool operator== (const Vector2d &_v) const
 Equal to operator. More...
 
double operator[] (unsigned int _index) const
 Array subscript operator. More...
 
void Set (double _x, double _y)
 Set the contents of the vector. More...
 

Public Attributes

double x
 x data More...
 
double y
 y data More...
 

Friends

std::ostream & operator<< (std::ostream &_out, const gazebo::math::Vector2d &_pt)
 Stream extraction operator. More...
 
std::istream & operator>> (std::istream &_in, gazebo::math::Vector2d &_pt)
 Stream extraction operator. More...
 

Detailed Description

Generic double x, y vector.

Constructor & Destructor Documentation

§ Vector2d() [1/4]

Vector2d ( )

Constructor.

§ Vector2d() [2/4]

Vector2d ( const double &  _x,
const double &  _y 
)

Constructor.

Parameters
[in]_xvalue along x
[in]_yvalue along y

§ Vector2d() [3/4]

Vector2d ( const Vector2d _v)

Copy constructor.

Parameters
[in]_vthe value

§ Vector2d() [4/4]

Vector2d ( const ignition::math::Vector2d &  _v)

Copy constructor for ignition math.

Parameters
[in]_vthe value

§ ~Vector2d()

virtual ~Vector2d ( )
virtual

Destructor.

Member Function Documentation

§ Distance()

double Distance ( const Vector2d _pt) const

Calc distance to the given point.

Parameters
[in]_ptThe point to measure to
Returns
the distance

§ Dot()

double Dot ( const Vector2d _v) const

Return the dot product of this vector and _v.

Parameters
[in]_vthe vector
Returns
the dot product

§ Ign()

ignition::math::Vector2d Ign ( ) const

Convert this vector to an ignition::math::Vector2d.

Returns
This vector as an ignition::math::Vector2d.

§ IsFinite()

bool IsFinite ( ) const

See if a point is finite (e.g., not nan)

Returns
true if finite, false otherwise

§ Normalize()

void Normalize ( )

Normalize the vector length.

§ operator!=()

bool operator!= ( const Vector2d _v) const

Not equal to operator.

Returns
true if elements are of diffent values (tolerence 1e-6)

§ operator*() [1/2]

const Vector2d operator* ( const Vector2d _v) const

Multiplication operators.

Parameters
[in]_vthe vector
Returns
the result

§ operator*() [2/2]

const Vector2d operator* ( double  _v) const

Multiplication operators.

Parameters
[in]_vthe scaling factor
Returns
a scaled vector

§ operator*=() [1/2]

const Vector2d& operator*= ( const Vector2d _v)

Multiplication assignment operator.

Remarks
this is an element wise multiplication
Parameters
[in]_vthe vector
Returns
this

§ operator*=() [2/2]

const Vector2d& operator*= ( double  _v)

Multiplication assignment operator.

Parameters
[in]_vthe scaling factor
Returns
a scaled vector

§ operator+()

Vector2d operator+ ( const Vector2d _v) const

Addition operator.

Parameters
[in]_vvector to add
Returns
sum vector

§ operator+=()

const Vector2d& operator+= ( const Vector2d _v)

Addition assignment operator.

Parameters
[in]_vthe vector to add

§ operator-()

Vector2d operator- ( const Vector2d _v) const

Subtraction operator.

Parameters
[in]_vthe vector to substract
Returns
the subtracted vector

§ operator-=()

const Vector2d& operator-= ( const Vector2d _v)

Subtraction assignment operator.

Parameters
[in]_vthe vector to substract
Returns
this

§ operator/() [1/2]

const Vector2d operator/ ( const Vector2d _v) const

Division operator.

Remarks
this is an element wise division
Parameters
[in]_va vector
Returns
a result

§ operator/() [2/2]

const Vector2d operator/ ( double  _v) const

Division operator.

Parameters
[in]_vthe value
Returns
a vector

§ operator/=() [1/2]

const Vector2d& operator/= ( const Vector2d _v)

Division operator.

Remarks
this is an element wise division
Parameters
[in]_va vector
Returns
this

§ operator/=() [2/2]

const Vector2d& operator/= ( double  _v)

Division operator.

Parameters
[in]_vthe divisor
Returns
a vector

§ operator=() [1/3]

Vector2d& operator= ( const Vector2d _v)

Assignment operator.

Parameters
[in]_va value for x and y element
Returns
this

§ operator=() [2/3]

Vector2d& operator= ( const ignition::math::Vector2d &  _v)

Assignment operator for ignition math.

Parameters
[in]_va value for x and y element
Returns
this

§ operator=() [3/3]

const Vector2d& operator= ( double  _v)

Assignment operator.

Parameters
[in]_vthe value for x and y element
Returns
this

§ operator==()

bool operator== ( const Vector2d _v) const

Equal to operator.

Parameters
[in]_vthe vector to compare to
Returns
true if the elements of the 2 vectors are equal within a tolerence (1e-6)

§ operator[]()

double operator[] ( unsigned int  _index) const

Array subscript operator.

Parameters
[in]_indexthe index
Returns
the value, or 0 if _index is out of bounds

§ Set()

void Set ( double  _x,
double  _y 
)

Set the contents of the vector.

Parameters
[in]_xvalue along x
[in]_yvalue along y

Friends And Related Function Documentation

§ operator<<

std::ostream& operator<< ( std::ostream &  _out,
const gazebo::math::Vector2d _pt 
)
friend

Stream extraction operator.

Parameters
[in]_outoutput stream
[in]_ptVector2d to output
Returns
The stream

§ operator>>

std::istream& operator>> ( std::istream &  _in,
gazebo::math::Vector2d _pt 
)
friend

Stream extraction operator.

Parameters
[in]_ininput stream
[in]_ptVector3 to read values into
Returns
The stream

Member Data Documentation

§ x

double x

x data

§ y

double y

y data


The documentation for this class was generated from the following file: