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

RS::CoordPoint< T > Class Template Reference

Template class for representing a cartesian two dimensional coordinate. More...

Inheritance diagram for RS::CoordPoint< T >:

[legend]
Collaboration diagram for RS::CoordPoint< T >:

[legend]
List of all members.

Public Member Functions

CoordPoint ()
Default constructor, the point is (T(), T()).

CoordPoint (const T &x, const T &y)
Construct a point using coordinates (x,y).

CoordPoint (const CoordPoint< T > &)
Copyconstructor.

CoordPoint (const CoordPoint< T > &, const CoordVector< T > &)
Create a point using a start point and a vector.

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

CoordPoint< T > & operator= (const CoordPoint< T > &)
Assignment operator.

getX () const
Get the x coordinate of the point.

getY () const
Get the y coordinate of the point.

CoordPoint< T > & addX (const T &pt_x)
Add to the x coordinate of the point.

CoordPoint< T > & addY (const T &pt_y)
Add to the x coordinate of the point.

CoordPoint< T > & addXY (const T &pt_x, const T &pt_y)
Add to x and y coordinate of the point.

CoordPoint< T > & setX (const T &pt_x)
Set the x coordinate of the point.

CoordPoint< T > & setY (const T &pt_y)
Set the y coordinate of the point.

CoordPoint< T > & set (const T &pt_x, const T &pt_y)
Set the x and y coordinate of the point.

CoordVector< T > getVectorTo (const CoordPoint< T > &pt) const
Get a vector between this point and point given in call.

AngleDegrees< T > getDirectionTo (const CoordPoint< T > &pt) const
Get the direction between this point and point given in call.

getDistanceTo (const CoordPoint< T > &pt) const
Get the distance between this point and point given in call.

Arithmetic operators.
CoordPoint< T > operator- () const
CoordPoint< T > operator- (const CoordPoint< T > &) const
CoordPoint< T > operator- (const CoordVector< T > &) const
CoordPoint< T > operator+ (const CoordPoint< T > &) const
CoordPoint< T > operator+ (const CoordVector< T > &) const
CoordPoint< T > operator * (const T &) const
CoordPoint< T > operator * (const CoordPoint< T > &) const
CoordPoint< T > operator/ (const T &) const
CoordPoint< T > operator/ (const CoordPoint< T > &) const
CoordPoint< T > & operator-= (const CoordPoint< T > &)
CoordPoint< T > & operator-= (const CoordVector< T > &)
CoordPoint< T > & operator+= (const CoordPoint< T > &)
CoordPoint< T > & operator+= (const CoordVector< T > &)
CoordPoint< T > & operator *= (const T &)
CoordPoint< T > & operator *= (const CoordPoint< T > &)
CoordPoint< T > & operator/= (const T &)
CoordPoint< T > & operator/= (const CoordPoint< T > &)
Comparison operators.
bool operator! () const
bool operator== (const CoordPoint< T > &pt) const
bool operator!= (const CoordPoint< T > &pt) const

Protected Attributes

x
The actual representation of the x coordinate value.

y
The actual representation of the y coordinate value.

Detailed Description

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

Template class for representing a cartesian two dimensional coordinate.

The X and Y values are of type T.

Todo:
More testing.

Check if all constructors and methods are needed.

Unit:
Library
Revision
1.9
Author
frehe
Date
2002/09/04 12:31:34

Definition at line 103 of file CoordPoint.h.

Constructor & Destructor Documentation

 template RS::CoordPoint< T >::CoordPoint ( const CoordVector< T > & ) ` [explicit]`
 Explicit constructor for converting a vector to a point. This is actually the same as using: CoordPoint(CoordPoint(), vector) since the vector is assumed is from origo. Definition at line 221 of file CoordPoint.h.

Member Function Documentation

 template CoordVector< T > RS::CoordPoint< T >::getVectorTo ( const CoordPoint< T > & pt ) const` [inline]`
 Get a vector between this point and point given in call. Very usefull! Definition at line 297 of file CoordPoint.h.

 template AngleDegrees< T > RS::CoordPoint< T >::getDirectionTo ( const CoordPoint< T > & pt ) const` [inline]`
 Get the direction between this point and point given in call. Very usefull! Definition at line 286 of file CoordPoint.h. References RS::CoordPoint< T >::x, and RS::CoordPoint< T >::y.

 template T RS::CoordPoint< T >::getDistanceTo ( const CoordPoint< T > & pt ) const` [inline]`
 Get the distance between this point and point given in call. Very usefull! Definition at line 291 of file CoordPoint.h. References RS::sqr(), RS::sqrt(), RS::CoordPoint< T >::x, and RS::CoordPoint< T >::y.

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