20 #ifndef ANTKEEPER_GEOM_PRIMITIVES_RAY_HPP
21 #define ANTKEEPER_GEOM_PRIMITIVES_RAY_HPP
28 namespace primitives {
36 template <
class T, std::
size_t N>
88 using namespace primitives;
constexpr point< T, N > closest_point(const ray< T, N > &a, const point< T, N > &b) noexcept
Calculates the closest point on a ray to a point.
constexpr T sqr_distance(const vector< T, N > &p0, const vector< T, N > &p1) noexcept
Calculates the square distance between two points.
vector< T, N > sqrt(const vector< T, N > &x)
Takes the square root of each element.
Half of a line proceeding from an initial point.
T distance(const vector_type &point) const noexcept
Calculates the distance from the ray to a point.
constexpr vector_type extrapolate(T distance) const noexcept
Extrapolates from the ray origin along the ray direction vector.
constexpr T sqr_distance(const vector_type &point) const noexcept
Calculates the square distance from the ray to a point.
vector_type direction
Ray direction vector.
vector_type origin
Ray origin position.