#include <Coord.h>
Class for a double-tuple storing a position / two-dimensional vector. Some comparison and basic arithmetic operators on Coord structures are implemented.
Public Member Functions | |
Coord (double _x=0, double _y=0) | |
Coord (const Coord &pos) | |
Coord (const Coord *pos) | |
std::string | info () const |
Coord | operator+= (Coord a) |
Coord | operator= (Coord a) |
Coord | operator-= (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+ (Coord a, Coord b) |
Coord | operator- (Coord a, Coord b) |
Coord | operator * (Coord a, double f) |
Coord | operator/ (Coord a, double f) |
bool | operator== (Coord a, Coord b) |
bool | operator!= (Coord a, Coord b) |
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.
00112 { 00113 return FWMath::close(a.x,b.x) && FWMath::close(a.y,b.y); 00114 }
double Coord::x |
x and y coordinates of the position
double Coord::y |