X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgeometry%2FVector.h;h=8822b1be5be769c1a792e6b93398fcd10d9e26b1;hb=ec25171b0b27999eb126e2144dae1e35f271b945;hp=ebff4b3905d14e209d9a877f66982700b925755f;hpb=f6691e2827a7eb8d2bdd3fbe175ecbfda09357ae;p=l2e.git diff --git a/src/geometry/Vector.h b/src/geometry/Vector.h index ebff4b3..8822b1b 100644 --- a/src/geometry/Vector.h +++ b/src/geometry/Vector.h @@ -1,10 +1,3 @@ -/* - * Vector.h - * - * Created on: Aug 6, 2012 - * Author: holy - */ - #ifndef GEOMETRY_VECTOR_H_ #define GEOMETRY_VECTOR_H_ @@ -31,6 +24,9 @@ public: Scalar X() const { return x; } Scalar Y() const { return y; } + Scalar &X() { return x; } + Scalar &Y() { return y; } + Scalar Index(Scalar lineLength) const { return Y() * lineLength + X(); } static Vector FromIndex(Scalar index, Scalar lineLength) { return Vector(index % lineLength, index / lineLength);