geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
Ray< T, N > Class Template Reference

Ray class. More...

#include <geomc/linalg/Ray.h>

Inheritance diagram for Ray< T, N >:
Dimensional< T, N >

Public Types

using elem_t
 The coordinate type of this object.
 
using point_t
 The type of a point in this object's space.
 

Public Member Functions

 Ray ()
 Construct a ray through the origin directed along the +x axis.
 
 Ray (point_t o, point_t v)
 Construct a ray through the point o with direction v.
 
point_t at_distance (T d) const
 Return the point along this ray's direction, at distance d from the ray origin.
 
point_t at_multiple (T s) const
 Return the point origin + s * direction.
 
dist2 (point_t p) const
 Compute the square of the distance from p to the nearest point on the ray.
 
Ray< T, Noperator- () const
 Return a ray pointing in the opposite direction.
 
point_t project (point_t p) const
 Find the point on the ray nearest to p by orhtogonally projecting p onto it.
 
template<index_t M>
Ray< T, M > resized () const
 Change the dimensionality of this Ray.
 
sdf (point_t p) const
 Signed distance from p to the nearest point on the ray.
 

Public Attributes

point_t direction
 Direction of ray.
 
point_t origin
 Origin of ray.
 

Static Public Attributes

static constexpr index_t N
 The dimension of this object.
 

Related Symbols

(Note that these are not member symbols.)

template<typename T, index_t N>
Ray< T, Noperator* (const Isometry< T, N > &xf, const Ray< T, N > &ray)
 Transform a ray.
 
template<typename T, index_t N>
PointType< T, N >::point_t operator* (const Ray< T, N > r, T s)
 
template<typename T, index_t N>
Ray< T, Noperator* (const Rotation< T, N > &rot, Ray< T, N > ray)
 Apply a rotation to a ray.
 
template<typename T, index_t N>
Ray< T, Noperator* (const Similarity< T, N > &i, const Ray< T, N > &ray)
 Transform a ray.
 
template<typename T, index_t N>
PointType< T, N >::point_t operator* (T s, const Ray< T, N > r)
 
template<typename T, index_t N>
Ray< T, Noperator/ (const Ray< T, N > &ray, const Isometry< T, N > &xf)
 Inverse-transform a ray.
 
template<typename T, index_t N>
Ray< T, Noperator/ (const Ray< T, N > &ray, const Similarity< T, N > &i)
 Inverse-transform a ray.
 
template<typename T, index_t N>
Ray< T, Noperator/ (Ray< T, N > ray, const Rotation< T, N > &rot)
 Apply the inverse of a rotation to a ray.
 

Detailed Description

template<typename T, index_t N>
class geom::Ray< T, N >

Ray class.

Template Parameters
TCoordinate type.
NDimensionality.

Member Typedef Documentation

◆ point_t

using point_t
inherited

The type of a point in this object's space.

An N-vector of T if N > 1, otherwise a T.


The documentation for this class was generated from the following files: