Antkeeper  0.0.1
Public Types | Public Member Functions | Public Attributes | List of all members
geom::primitives::ray< T, N > Struct Template Reference

Half of a line proceeding from an initial point. More...

#include <ray.hpp>

Public Types

using vector_type = math::vector< T, N >
 Vector type. More...
 

Public Member Functions

constexpr vector_type extrapolate (T distance) const noexcept
 Extrapolates from the ray origin along the ray direction vector. More...
 
constexpr T sqr_distance (const vector_type &point) const noexcept
 Calculates the square distance from the ray to a point. More...
 
distance (const vector_type &point) const noexcept
 Calculates the distance from the ray to a point. More...
 

Public Attributes

vector_type origin
 Ray origin position. More...
 
vector_type direction
 Ray direction vector. More...
 

Detailed Description

template<class T, std::size_t N>
struct geom::primitives::ray< T, N >

Half of a line proceeding from an initial point.

Template Parameters
TReal type.
NNumber of dimensions.

Definition at line 37 of file ray.hpp.

Member Typedef Documentation

◆ vector_type

template<class T , std::size_t N>
using geom::primitives::ray< T, N >::vector_type = math::vector<T, N>

Vector type.

Definition at line 40 of file ray.hpp.

Member Function Documentation

◆ distance()

template<class T , std::size_t N>
T geom::primitives::ray< T, N >::distance ( const vector_type point) const
inlinenoexcept

Calculates the distance from the ray to a point.

Parameters
pointInput point.
Returns
Distance from the ray to point.

Definition at line 79 of file ray.hpp.

◆ extrapolate()

template<class T , std::size_t N>
constexpr vector_type geom::primitives::ray< T, N >::extrapolate ( distance) const
inlineconstexprnoexcept

Extrapolates from the ray origin along the ray direction vector.

Parameters
distanceSigned extrapolation distance.
Returns
Extrapolated coordinates.

Definition at line 55 of file ray.hpp.

◆ sqr_distance()

template<class T , std::size_t N>
constexpr T geom::primitives::ray< T, N >::sqr_distance ( const vector_type point) const
inlineconstexprnoexcept

Calculates the square distance from the ray to a point.

Parameters
pointInput point.
Returns
Square distance from the ray to point.

Definition at line 67 of file ray.hpp.

Member Data Documentation

◆ direction

template<class T , std::size_t N>
vector_type geom::primitives::ray< T, N >::direction

Ray direction vector.

Definition at line 46 of file ray.hpp.

◆ origin

template<class T , std::size_t N>
vector_type geom::primitives::ray< T, N >::origin

Ray origin position.

Definition at line 43 of file ray.hpp.


The documentation for this struct was generated from the following file: