1 #ifndef LIBR2C2_GEOMETRY_H_
2 #define LIBR2C2_GEOMETRY_H_
6 #include <msp/geometry/affinetransformation.h>
7 #include <msp/geometry/angle.h>
8 #include <msp/linal/vector.h>
12 typedef Msp::LinAl::Vector<float, 3> Vector;
14 inline float distance(const Vector &p, const Vector &q)
15 { return (p-q).norm(); }
17 typedef Msp::Geometry::Angle<float> Angle;
19 typedef Msp::Geometry::AffineTransformation<float, 3> Transform;
21 inline Vector rotated_vector(const Vector &v, const Angle &a)
22 { return Transform::rotation(a, Vector(0, 0, 1)).transform(v); }
24 inline Vector vector_at_angle(const Angle &a)
25 { return rotated_vector(Vector(1, 0, 0), a); }
33 TrackPoint(): grade(0) { }