--- /dev/null
+#include <msp/geometry/circle.h>
+#include <msp/linal/vector2.h>
+#include <msp/test/test.h>
+
+using namespace Msp;
+
+class HyperSphereTests: public Test::RegisteredTest<HyperSphereTests>
+{
+public:
+ HyperSphereTests();
+
+ static const char *get_name() { return "HyperSphere"; }
+
+private:
+ void ray_intersection();
+};
+
+HyperSphereTests::HyperSphereTests()
+{
+ add(&HyperSphereTests::ray_intersection, "Ray intersection");
+}
+
+void HyperSphereTests::ray_intersection()
+{
+ Geometry::Circle<double> circle(1.5);
+ Geometry::Ray<double, 2> ray(LinAl::Vector2<double>(2.5, 0), LinAl::Vector2<double>(-1, 0));
+ EXPECT(circle.check_intersection(ray));
+ ray = Geometry::Ray<double, 2>(LinAl::Vector2<double>(2.5, 0), LinAl::Vector2<double>(1, 0));
+ EXPECT(!circle.check_intersection(ray));
+ ray = Geometry::Ray<double, 2>(LinAl::Vector2<double>(2.5, 0), LinAl::Vector2<double>(-4, 2.95));
+ EXPECT(circle.check_intersection(ray));
+ ray = Geometry::Ray<double, 2>(LinAl::Vector2<double>(2.5, 0), LinAl::Vector2<double>(-4, 3.05));
+ EXPECT(!circle.check_intersection(ray));
+}