Class for storing host positions. More...
#include <Coord.h>
Public Member Functions | |
Coord (double _x=0, double _y=0) | |
Coord (const Coord &pos) | |
Coord (const Coord *pos) | |
std::string | info () const |
const Coord & | operator+= (const Coord &a) |
const Coord & | operator= (const Coord &a) |
const Coord & | operator-= (const Coord &a) |
double | distance (const Coord &a) const |
double | sqrdist (const Coord &a) 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) |
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.
Definition at line 38 of file Coord.h.
Coord::Coord | ( | double | _x = 0 , |
|
double | _y = 0 | |||
) | [inline] |
Coord::Coord | ( | const Coord & | pos | ) | [inline] |
Coord::Coord | ( | const Coord * | pos | ) | [inline] |
double Coord::distance | ( | const Coord & | a | ) | const [inline] |
std::string Coord::info | ( | ) | const [inline] |
double Coord::sqrdist | ( | const Coord & | a | ) | const [inline] |
Tests whether two coordinate vectors are equal. Because coordinates are of type double, this is done through the FWMath::close function.
Definition at line 112 of file Coord.h.
{ return FWMath::close(a.x,b.x) && FWMath::close(a.y,b.y); }
double Coord::x |
x and y coordinates of the position
Definition at line 42 of file Coord.h.
Referenced by Coord(), operator+=(), operator-=(), operator<<(), operator=(), and sqrdist().
double Coord::y |
Definition at line 42 of file Coord.h.
Referenced by Coord(), operator+=(), operator-=(), operator<<(), operator=(), and sqrdist().