26 #ifndef GRALE_RECTANGULARCOORDINATES_H
28 #define GRALE_RECTANGULARCOORDINATES_H
30 #include "graleconfig.h"
31 #include "coordinateinterface.h"
36 class GRALE_IMPORTEXPORT RectangularCoordinates :
public CoordinateInterface
39 RectangularCoordinates(Vector2D<double> bottomleft, Vector2D<double> topright,
int nx,
int ny)
41 xstep = (topright.getX()-bottomleft.getX())/((
double)(nx));
42 ystep = (topright.getY()-bottomleft.getY())/((
double)(ny));
43 xstart = bottomleft.getX();
44 ystart = bottomleft.getY();
47 ~RectangularCoordinates() { }
48 Vector2D<double> operator()(IntVector2D pos)
const {
return Vector2D<double>(xstep*((double)pos.getX())+xstart+xstep/2.0, ystep*((
double)pos.getY())+ystart+ystep/2.0); }
49 CoordinateInterface *createCopy() const;
51 RectangularCoordinates() { }
59 #endif // GRALE_RECTANGULARCOORDINATES_H