All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Friends | List of all members
gazebo::math::Vector2d Class Reference

Generic double x, y vector. More...

#include <Vector2d.hh>

Public Member Functions

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

Public Attributes

double x
 x data
 
double y
 y data
 

Friends

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

Detailed Description

Generic double x, y vector.

Constructor & Destructor Documentation

gazebo::math::Vector2d::Vector2d ( )

Constructor.

gazebo::math::Vector2d::Vector2d ( const double &  _x,
const double &  _y 
)

Constructor.

Parameters
[in]_xvalue along x
[in]_yvalue along y
gazebo::math::Vector2d::Vector2d ( const Vector2d _v)

Copy constructor.

Parameters
[in]_vthe value
virtual gazebo::math::Vector2d::~Vector2d ( )
virtual

Destructor.

Member Function Documentation

Vector2d gazebo::math::Vector2d::Cross ( const Vector2d _v) const

Return the cross product of this vector and _v.

Parameters
[in]_vthe vector
Returns
the cross product
double gazebo::math::Vector2d::Distance ( const Vector2d _pt) const

Calc distance to the given point.

Parameters
[in]_ptThe point to measure to
Returns
the distance
bool gazebo::math::Vector2d::IsFinite ( ) const

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

Returns
true if finite, false otherwise
void gazebo::math::Vector2d::Normalize ( )

Normalize the vector length.

bool gazebo::math::Vector2d::operator!= ( const Vector2d _v) const

Not equal to operator.

Returns
true if elements are of diffent values (tolerence 1e-6)
const Vector2d gazebo::math::Vector2d::operator* ( const Vector2d _v) const

Multiplication operators.

Parameters
[in]_vthe vector
Returns
the result
const Vector2d gazebo::math::Vector2d::operator* ( double  _v) const

Multiplication operators.

Parameters
[in]_vthe scaling factor
Returns
a scaled vector
const Vector2d& gazebo::math::Vector2d::operator*= ( const Vector2d _v)

Multiplication assignment operator.

Remarks
this is an element wise multiplication
Parameters
[in]_vthe vector
Returns
this
const Vector2d& gazebo::math::Vector2d::operator*= ( double  _v)

Multiplication assignment operator.

Parameters
[in]_vthe scaling factor
Returns
a scaled vector
Vector2d gazebo::math::Vector2d::operator+ ( const Vector2d _v) const

Addition operator.

Parameters
[in]_vvector to add
Returns
sum vector
const Vector2d& gazebo::math::Vector2d::operator+= ( const Vector2d _v)

Addition assignment operator.

Parameters
[in]_vthe vector to add
Vector2d gazebo::math::Vector2d::operator- ( const Vector2d _v) const

Subtraction operator.

Parameters
[in]_vthe vector to substract
Returns
the subtracted vector
const Vector2d& gazebo::math::Vector2d::operator-= ( const Vector2d _v)

Subtraction assignment operator.

Parameters
[in]_vthe vector to substract
Returns
this
const Vector2d gazebo::math::Vector2d::operator/ ( const Vector2d _v) const

Division operator.

Remarks
this is an element wise division
Parameters
[in]_va vector
Returns
a result
const Vector2d gazebo::math::Vector2d::operator/ ( double  _v) const

Division operator.

Parameters
[in]_vthe value
Returns
a vector
const Vector2d& gazebo::math::Vector2d::operator/= ( const Vector2d _v)

Division operator.

Remarks
this is an element wise division
Parameters
[in]_va vector
Returns
this
const Vector2d& gazebo::math::Vector2d::operator/= ( double  _v)

Division operator.

Parameters
[in]_vthe divisor
Returns
a vector
Vector2d& gazebo::math::Vector2d::operator= ( const Vector2d _v)

Assignment operator.

Parameters
[in]_va value for x and y element
Returns
this
const Vector2d& gazebo::math::Vector2d::operator= ( double  _v)

Assignment operator.

Parameters
[in]_vthe value for x and y element
Returns
this
bool gazebo::math::Vector2d::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)
double gazebo::math::Vector2d::operator[] ( unsigned int  _index) const

Array subscript operator.

Parameters
[in]_indexthe index
Returns
the value, or 0 if _index is out of bounds
void gazebo::math::Vector2d::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

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
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

double gazebo::math::Vector2d::x

x data

double gazebo::math::Vector2d::y

y data


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