#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 |
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) |
Class for a double-tuple storing a position / two-dimensional vector. Some comparison and basic arithmetic operators on Coord structures are implemented.
|
Initializes coordinates. |
|
Initializes coordinates. |
|
Initializes coordinates. |
|
Returns the distance to Coord a |
|
Adds coordinate vector b to a. |
|
Subtracts coordinate vector b from a. |
|
Assigns a this. |
|
Returns distance^2 to Coord a (omits square root). |
|
Returns the squared distance on a torus to Coord a (omits square root). |
|
Multiplies a coordinate vector by a real number. |
|
Tests whether two coordinate vectors are not equal. Negation of the operator==. |
|
Adds two coordinate vectors. |
|
Subtracts two coordinate vectors. |
|
Divides a coordinate vector by a real number. |
|
Tests whether two coordinate vectors are equal. Because coordinates are of type double, this is done through the FWMath::close function. |