Two dimensional (x, y) vector. More...
#include <ignition/math/Vector2.hh>
Public Member Functions | |
| Vector2 () | |
| Default Constructor. More... | |
| Vector2 (const T &_x, const T &_y) | |
| Constructor. More... | |
| Vector2 (const Vector2< T > &_v) | |
| Copy constructor. More... | |
| virtual | ~Vector2 () |
| Destructor. More... | |
| double | Distance (const Vector2 &_pt) const |
| Calc distance to the given point. More... | |
| T | Dot (const Vector2< T > &_v) const |
| Get 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 Vector2 &_v) const |
| Not equal to operator. More... | |
| const Vector2 | operator* (const Vector2 &_v) const |
| Multiplication operators. More... | |
| const Vector2 | operator* (T _v) const |
| Multiplication operators. More... | |
| const Vector2 & | operator*= (const Vector2 &_v) |
| Multiplication assignment operator. More... | |
| const Vector2 & | operator*= (T _v) |
| Multiplication assignment operator. More... | |
| Vector2 | operator+ (const Vector2 &_v) const |
| Addition operator. More... | |
| const Vector2 & | operator+= (const Vector2 &_v) |
| Addition assignment operator. More... | |
| Vector2 | operator- (const Vector2 &_v) const |
| Subtraction operator. More... | |
| const Vector2 & | operator-= (const Vector2 &_v) |
| Subtraction assignment operator. More... | |
| const Vector2 | operator/ (const Vector2 &_v) const |
| Division operator. More... | |
| const Vector2 | operator/ (T _v) const |
| Division operator. More... | |
| const Vector2 & | operator/= (const Vector2 &_v) |
| Division operator. More... | |
| const Vector2 & | operator/= (T _v) |
| Division operator. More... | |
| bool | operator< (const Vector2< T > &_pt) const |
| Less than operator. More... | |
| Vector2 & | operator= (const Vector2 &_v) |
| Assignment operator. More... | |
| const Vector2 & | operator= (T _v) |
| Assignment operator. More... | |
| bool | operator== (const Vector2 &_v) const |
| Equal to operator. More... | |
| T | operator[] (size_t _index) const |
| Array subscript operator. More... | |
| void | Set (T _x, T _y) |
| Set the contents of the vector. More... | |
| T | X () const |
| Return the x value. More... | |
| T & | X () |
| Return a mutable x value. More... | |
| void | X (const T &_v) |
| Set the x value. More... | |
| T | Y () const |
| Return the y value. More... | |
| T & | Y () |
| Return a mutable y value. More... | |
| void | Y (const T &_v) |
| Set the y value. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &_out, const Vector2< T > &_pt) |
| Stream extraction operator. More... | |
| std::istream & | operator>> (std::istream &_in, Vector2< T > &_pt) |
| Stream extraction operator. More... | |
Two dimensional (x, y) vector.
|
inline |
Default Constructor.
Referenced by ignition::math::Vector2< T >::operator*(), ignition::math::Vector2< T >::operator+(), ignition::math::Vector2< T >::operator-(), and ignition::math::Vector2< T >::operator/().
|
inline |
Constructor.
| [in] | _x | value along x |
| [in] | _y | value along y |
|
inline |
Copy constructor.
| [in] | _v | the value |
|
inlinevirtual |
Destructor.
|
inline |
Calc distance to the given point.
| [in] | _pt | The point to measure to |
|
inline |
Get the dot product of this vector and _v.
| [in] | _v | the vector |
Referenced by ignition::math::Triangle< T >::Contains().
|
inline |
See if a point is finite (e.g., not nan)
|
inline |
Normalize the vector length.
|
inline |
Not equal to operator.
|
inline |
Multiplication operators.
| [in] | _v | the vector |
References ignition::math::Vector2< T >::Vector2().
|
inline |
Multiplication operators.
| [in] | _v | the scaling factor |
References ignition::math::Vector2< T >::Vector2().
|
inline |
Multiplication assignment operator.
| [in] | _v | the vector |
|
inline |
Multiplication assignment operator.
| [in] | _v | the scaling factor |
|
inline |
Addition operator.
| [in] | _v | vector to add |
References ignition::math::Vector2< T >::Vector2().
|
inline |
Addition assignment operator.
| [in] | _v | the vector to add |
|
inline |
Subtraction operator.
| [in] | _v | the vector to substract |
References ignition::math::Vector2< T >::Vector2().
|
inline |
Subtraction assignment operator.
| [in] | _v | the vector to substract |
|
inline |
Division operator.
| [in] | _v | a vector |
References ignition::math::Vector2< T >::Vector2().
|
inline |
Division operator.
| [in] | _v | the value |
References ignition::math::Vector2< T >::Vector2().
|
inline |
Division operator.
| [in] | _v | a vector |
|
inline |
Division operator.
| [in] | _v | the divisor |
|
inline |
Less than operator.
| [in] | _pt | Vector to compare. |
|
inline |
Assignment operator.
| [in] | _v | a value for x and y element |
|
inline |
Assignment operator.
| [in] | _v | the value for x and y element |
|
inline |
Equal to operator.
| [in] | _v | the vector to compare to |
References ignition::math::equal().
|
inline |
Array subscript operator.
| [in] | _index | the index |
| IndexException | if _index is >= 2. |
|
inline |
Set the contents of the vector.
| [in] | _x | value along x |
| [in] | _y | value along y |
|
inline |
Return the x value.
| N/A. |
Referenced by ignition::math::Line2< T >::CrossProduct(), ignition::math::Line2< T >::Intersect(), and ignition::math::Line2< T >::Within().
|
inline |
Return a mutable x value.
| N/A. |
|
inline |
Set the x value.
| [in] | _v | Value for the x component. |
|
inline |
Return the y value.
| N/A. |
Referenced by ignition::math::Line2< T >::CrossProduct(), ignition::math::Line2< T >::Intersect(), and ignition::math::Line2< T >::Within().
|
inline |
Return a mutable y value.
| N/A. |
|
inline |
Set the y value.
| [in] | _v | Value for the y component. |
|
friend |
Stream extraction operator.
| [in] | _out | output stream |
| [in] | _pt | Vector2 to output |
| N/A. |
|
friend |
Stream extraction operator.
| [in] | _in | input stream |
| [in] | _pt | Vector2 to read values into |
| N/A. |