Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

Coord Class Reference

Class for storing host positions. More...

#include <Coord.h>

List of all members.

Public Member Functions

 Coord (double _x=0, double _y=0)
 Coord (const Coord &pos)
 Coord (const Coord *pos)
std::string info () const
Coord operator+= (const Coord &a)
Coord operator= (const Coord &a)
Coord operator-= (const Coord &a)
double distance (const Coord &a) const
double sqrdist (const Coord &a) const
double sqrTorusDist (const Coord &b, const Coord &playGround) const

Public Attributes

double x
 x and y coordinates of the position
double y

Friends

Coord operator+ (const Coord &a, const Coord &b)
Coord operator- (const Coord &a, const Coord &b)
Coord operator * (const Coord &a, double f)
Coord operator/ (const Coord &a, double f)
bool operator== (const Coord &a, const Coord &b)
bool operator!= (const Coord &a, const Coord &b)


Detailed Description

Class for storing host positions.

Class for a double-tuple storing a position / two-dimensional vector. Some comparison and basic arithmetic operators on Coord structures are implemented.

Author:
Christian Frank


Constructor & Destructor Documentation

Coord::Coord double  _x = 0,
double  _y = 0
[inline]
 

Initializes coordinates.

Coord::Coord const Coord pos  )  [inline]
 

Initializes coordinates.

Coord::Coord const Coord pos  )  [inline]
 

Initializes coordinates.


Member Function Documentation

double Coord::distance const Coord a  )  const [inline]
 

Returns the distance to Coord a

Coord Coord::operator+= const Coord a  )  [inline]
 

Adds coordinate vector b to a.

Coord Coord::operator-= const Coord a  )  [inline]
 

Subtracts coordinate vector b from a.

Coord Coord::operator= const Coord a  )  [inline]
 

Assigns a this.

double Coord::sqrdist const Coord a  )  const [inline]
 

Returns distance^2 to Coord a (omits square root).

double Coord::sqrTorusDist const Coord b,
const Coord playGround
const [inline]
 

Returns the squared distance on a torus to Coord a (omits square root).


Friends And Related Function Documentation

Coord operator * const Coord a,
double  f
[friend]
 

Multiplies a coordinate vector by a real number.

bool operator!= const Coord a,
const Coord b
[friend]
 

Tests whether two coordinate vectors are not equal. Negation of the operator==.

Coord operator+ const Coord a,
const Coord b
[friend]
 

Adds two coordinate vectors.

Coord operator- const Coord a,
const Coord b
[friend]
 

Subtracts two coordinate vectors.

Coord operator/ const Coord a,
double  f
[friend]
 

Divides a coordinate vector by a real number.

bool operator== const Coord a,
const Coord b
[friend]
 

Tests whether two coordinate vectors are equal. Because coordinates are of type double, this is done through the FWMath::close function.


The documentation for this class was generated from the following file:
Generated on Fri Jan 12 08:29:53 2007 for Mobility Framework by  doxygen 1.4.4