+ return contains(ray.get_start()-ray.get_direction()*x);
+}
+
+template<typename T, unsigned D>
+inline unsigned HyperSphere<T, D>::get_intersections(const Ray<T, D> &ray, SurfacePoint<T, D> *points, unsigned size) const
+{
+ using std::sqrt;
+
+ T mid = -inner_product(ray.get_direction(), ray.get_start());
+ LinAl::Vector<T, D> nearest = ray.get_start()+ray.get_direction()*mid;
+ T offset_sq = radius*radius-inner_product(nearest, nearest);
+ if(offset_sq<0)
+ return 0;
+ T offset = sqrt(offset_sq);
+
+ unsigned n = 0;
+ for(int i=-1; i<=1; i+=2)