--- /dev/null
+#include <msp/geometry/rectangle.h>
+#include <msp/geometry/transformedshape.h>
+#include <msp/test/test.h>
+
+using namespace Msp;
+
+class TransformedShapeTests: public Test::RegisteredTest<TransformedShapeTests>
+{
+public:
+ TransformedShapeTests();
+
+ static const char *get_name() { return "TransformedShape"; }
+
+private:
+ void ray_intersection();
+};
+
+TransformedShapeTests::TransformedShapeTests()
+{
+ add(&TransformedShapeTests::ray_intersection, "Ray intersection");
+}
+
+void TransformedShapeTests::ray_intersection()
+{
+ Geometry::TransformedShape<double, 2> shape(Geometry::Rectangle<double>(2, 1), Geometry::AffineTransformation<double, 2>::rotation(Geometry::Angle<double>::from_degrees(45)));
+ Geometry::Ray<double, 2> ray(LinAl::Vector2<double>(3, 1.05), LinAl::Vector2<double>(-1, 0));
+ EXPECT(shape.check_intersection(ray));
+ ray = Geometry::Ray<double, 2>(LinAl::Vector2<double>(2.65, 3.35), LinAl::Vector2<double>(-1, -1));
+ EXPECT(shape.check_intersection(ray));
+ ray = Geometry::Ray<double, 2>(LinAl::Vector2<double>(2.6, 3.4), LinAl::Vector2<double>(-1, -1));
+ EXPECT(!shape.check_intersection(ray));
+}