+template<typename T, unsigned D>
+inline Ray<T, D>::Ray(const LinAl::Vector<T, D> &s, const LinAl::Vector<T, D> &d, T l):
+ start(s),
+ direction(normalize(d)),
+ limit(l)
+{
+ if(l<T(0))
+ throw std::invalid_argument("Ray::Ray");
+}
+
+template<typename T, unsigned D>
+inline bool Ray<T, D>::check_limits(T x) const
+{
+ return x>=T(0) && (!limit || x<=limit);
+}
+