Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RS::CoordVector< T > Class Template Reference

Template class for representing a two dimensional mathematical vector. More...

Collaboration diagram for RS::CoordVector< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CoordVector ()
 Default constructor, the zerovector.

 CoordVector (const T &dir, const T &dist)
 Construct a vector using a direction and a distance.

 CoordVector (const AngleDegrees< T > &ang, const T &dist)
 Construct a vector using a angle (as direction) and a distance.

 CoordVector (const CoordVector &vec)
 Copyconstructor.

 CoordVector (const CoordPoint< T > &pt1, const CoordPoint< T > &pt2)
 Construct a vector based on the distance and angle between two points.

 CoordVector (const CoordPoint< T > &pt)
 Explicit constructor for converting a point to a vector.

CoordVector< T > & operator= (const CoordVector< T > &vec)
 Assignment operator.

CoordVector< T > & rotate (const AngleDegrees< T > &ang)
 Adds to the angle of the vector.

CoordVector< T > & addLength (const T &val)
 Adds to the distance of the vector.

getLength () const
 Returns the length of the vector.

CoordVector< T > & setLength (const T &val)
 Set the length of the vector.

AngleDegrees< T > getAngle () const
 Returns the angle of the vector.

CoordVector< T > & setAngle (const AngleDegrees< T > &ang)
 Set the angle of the vector.

crossProduct (const CoordVector< T > &v) const
 Get the cross product from two CoordVectors.

dotProduct (const CoordVector< T > &v) const
 Get the dot product from two CoordVectors.

CoordVector< T > projectOn (const CoordVector< T > &v) const
 Projects vector onto another vector.

angleBetween (const CoordVector< T > &v) const
 Get the absolute angle between two CoordVectors.

Arithmetic operators.
CoordVector< T > operator- () const
CoordVector< T > operator+ (const CoordVector< T > &vec) const
CoordVector< T > operator- (const CoordVector< T > &vec) const
CoordVector< T > operator * (const T &val) const
CoordVector< T > operator/ (const T &val) const
CoordVector< T > & operator-= (const CoordVector< T > &vec)
CoordVector< T > & operator+= (const CoordVector< T > &vec)
CoordVector< T > & operator *= (const T &val)
CoordVector< T > & operator/= (const T &val)
Comparison operators.
bool operator! () const
 Check if the vector is the zero vector?

bool operator== (const CoordVector< T > &vec) const
 Are the vectors equal or not.

bool operator!= (const CoordVector< T > &vec) const
 Are the vectors equal or not.

bool operator< (const CoordVector< T > &vec) const
 Compares the length of the vectors.

bool operator<= (const CoordVector< T > &vec) const
 Compares the length of the vectors.

bool operator> (const CoordVector< T > &vec) const
 Compares the length of the vectors.

bool operator>= (const CoordVector< T > &vec) const
 Compares the length of the vectors.


Protected Attributes

AngleDegrees< T > dir
 The actual representation of the direction of the vector.

dist
 The actual representation of the distance of the vector.


Detailed Description

template<typename T>
class RS::CoordVector< T >

Template class for representing a two dimensional mathematical vector.

The distance and direction are of type T. T is the base type for the angle: AngleDegrees<T> and the distance T.

Todo:
Think about the method names. Fix it?
Unit:
Library
Revision
1.13
Author
frehe
Date
2008/09/26 19:44:46

Definition at line 112 of file CoordVector.h.


The documentation for this class was generated from the following file:
Generated on Mon Aug 29 08:22:26 2011 for RoboSoc by doxygen1.3-rc3