#ifndef MSP_GEOMETRY_HYPERSPHERE_H_
#define MSP_GEOMETRY_HYPERSPHERE_H_
+#include <cmath>
#include <msp/linal/vector.h>
#include "hyperbox.h"
#include "ray.h"
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);