X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fgeometry.h;h=8519499ef581c5d6a67ea656d1dbe1fee32aecb1;hb=f8a7788cee0261babfc4c804a58515aad6dfbc3d;hp=48bbd49eeb98736b5274dbd50ec91d723649b8be;hpb=460c64181aca1a134d74cb15ea4ad3bb4f275b60;p=r2c2.git diff --git a/source/libr2c2/geometry.h b/source/libr2c2/geometry.h index 48bbd49..8519499 100644 --- a/source/libr2c2/geometry.h +++ b/source/libr2c2/geometry.h @@ -13,21 +13,21 @@ Distributed under the GPL namespace R2C2 { -struct Point +struct Vector { float x, y, z; - Point(): x(0), y(0), z(0) { } - Point(float x_, float y_): x(x_), y(y_), z(0) { } - Point(float x_, float y_, float z_): x(x_), y(y_), z(z_) { } + Vector(): x(0), y(0), z(0) { } + Vector(float x_, float y_): x(x_), y(y_), z(0) { } + Vector(float x_, float y_, float z_): x(x_), y(y_), z(z_) { } }; -inline float distance(const Point &p, const Point &q) +inline float distance(const Vector &p, const Vector &q) { return sqrt((p.x-q.x)*(p.x-q.x) + (p.y-q.y)*(p.y-q.y) + (p.z-q.z)*(p.z-q.z)); } struct TrackPoint { - Point pos; + Vector pos; float dir; float grade;