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/geometry/ray.h>
9 #include <msp/geometry/shape.h>
10 #include <msp/linal/vector.h>
14 typedef Msp::LinAl::Vector<float, 3> Vector;
16 inline float distance(const Vector &p, const Vector &q)
17 { return (p-q).norm(); }
19 typedef Msp::Geometry::Angle<float> Angle;
21 typedef Msp::Geometry::AffineTransformation<float, 3> Transform;
23 inline Vector rotated_vector(const Vector &v, const Angle &a)
24 { return Transform::rotation(a, Vector(0, 0, 1)).transform(v); }
26 inline Vector vector_at_angle(const Angle &a)
27 { return rotated_vector(Vector(1, 0, 0), a); }
29 typedef Msp::Geometry::Shape<float, 3> Shape;
30 typedef Msp::Geometry::Ray<float, 3> Ray;
31 typedef Msp::Geometry::BoundingBox<float, 3> BoundingBox;