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 Vector2d & | operator*= (const Vector2d &_v) |
Multiplication assignment operator. | |
const Vector2d & | operator*= (double _v) |
Multiplication assignment operator. | |
Vector2d | operator+ (const Vector2d &_v) const |
Addition operator. | |
const Vector2d & | operator+= (const Vector2d &_v) |
Addition assignment operator. | |
Vector2d | operator- (const Vector2d &_v) const |
Subtraction operator. | |
const Vector2d & | operator-= (const Vector2d &_v) |
Subtraction assignment operator. | |
const Vector2d | operator/ (const Vector2d &_v) const |
Division operator. | |
const Vector2d | operator/ (double _v) const |
Division operator. | |
const Vector2d & | operator/= (const Vector2d &_v) |
Division operator. | |
const Vector2d & | operator/= (double _v) |
Division operator. | |
Vector2d & | operator= (const Vector2d &_v) |
Assignment operator. | |
const Vector2d & | operator= (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. | |
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.
Return the cross product of this vector and _v.
[in] | _v | the vector |
double gazebo::math::Vector2d::Distance | ( | const Vector2d & | _pt | ) | const |
Calc distance to the given point.
[in] | _pt | The point to measure to |
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