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... | |
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... | |
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 Vector2d & | operator*= (const Vector2d &_v) |
Multiplication assignment operator. More... | |
const Vector2d & | operator*= (double _v) |
Multiplication assignment operator. More... | |
Vector2d | operator+ (const Vector2d &_v) const |
Addition operator. More... | |
const Vector2d & | operator+= (const Vector2d &_v) |
Addition assignment operator. More... | |
Vector2d | operator- (const Vector2d &_v) const |
Subtraction operator. More... | |
const Vector2d & | operator-= (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 Vector2d & | operator/= (const Vector2d &_v) |
Division operator. More... | |
const Vector2d & | operator/= (double _v) |
Division operator. More... | |
Vector2d & | operator= (const Vector2d &_v) |
Assignment operator. More... | |
const Vector2d & | operator= (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... | |
Generic double x, y vector.
gazebo::math::Vector2d::Vector2d | ( | ) |
Constructor.
gazebo::math::Vector2d::Vector2d | ( | const double & | _x, |
const double & | _y | ||
) |
Constructor.
[in] | _x | value along x |
[in] | _y | value along y |
gazebo::math::Vector2d::Vector2d | ( | const Vector2d & | _v | ) |
Copy constructor.
[in] | _v | the value |
|
virtual |
Destructor.
double gazebo::math::Vector2d::Distance | ( | const Vector2d & | _pt | ) | const |
Calc distance to the given point.
[in] | _pt | The point to measure to |
double gazebo::math::Vector2d::Dot | ( | const Vector2d & | _v | ) | const |
Return the dot product of this vector and _v.
[in] | _v | the vector |
bool gazebo::math::Vector2d::IsFinite | ( | ) | const |
See if a point is finite (e.g., not nan)
void gazebo::math::Vector2d::Normalize | ( | ) |
Normalize the vector length.
bool gazebo::math::Vector2d::operator!= | ( | const Vector2d & | _v | ) | const |
Not equal to operator.
Multiplication operators.
[in] | _v | the vector |
const Vector2d gazebo::math::Vector2d::operator* | ( | double | _v | ) | const |
Multiplication operators.
[in] | _v | the scaling factor |
Multiplication assignment operator.
[in] | _v | the vector |
const Vector2d& gazebo::math::Vector2d::operator*= | ( | double | _v | ) |
Multiplication assignment operator.
[in] | _v | the scaling factor |
Addition operator.
[in] | _v | vector to add |
Addition assignment operator.
[in] | _v | the vector to add |
Subtraction operator.
[in] | _v | the vector to substract |
Subtraction assignment operator.
[in] | _v | the vector to substract |
Division operator.
[in] | _v | a vector |
const Vector2d gazebo::math::Vector2d::operator/ | ( | double | _v | ) | const |
Division operator.
[in] | _v | the value |
Division operator.
[in] | _v | a vector |
const Vector2d& gazebo::math::Vector2d::operator/= | ( | double | _v | ) |
Division operator.
[in] | _v | the divisor |
Assignment operator.
[in] | _v | a value for x and y element |
const Vector2d& gazebo::math::Vector2d::operator= | ( | double | _v | ) |
Assignment operator.
[in] | _v | the value for x and y element |
bool gazebo::math::Vector2d::operator== | ( | const Vector2d & | _v | ) | const |
Equal to operator.
[in] | _v | the vector to compare to |
double gazebo::math::Vector2d::operator[] | ( | unsigned int | _index | ) | const |
Array subscript operator.
[in] | _index | the index |
void gazebo::math::Vector2d::Set | ( | double | _x, |
double | _y | ||
) |
Set the contents of the vector.
[in] | _x | value along x |
[in] | _y | value along y |
|
friend |
Stream extraction operator.
[in] | _out | output stream |
[in] | _pt | Vector2d to output |
|
friend |
Stream extraction operator.
[in] | _in | input stream |
[in] | _pt | Vector3 to read values into |
double gazebo::math::Vector2d::x |
x data
double gazebo::math::Vector2d::y |
y data