AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::primal::Segment< T, NDIMS > Class Template Reference

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.5.0/src/axom/primal/geometry/Segment.hpp>

Public Types

typedef Point< T, NDIMS > PointType
 

Public Member Functions

 Segment (const PointType &A, const PointType &B)
 Creates a segment instance from point A to point B. More...
 
 ~Segment ()
 Destructor. More...
 
const PointTypesource () const
 Returns the source point of the segment. More...
 
const PointTypetarget () const
 Returns the target point of the segment. More...
 
PointType at (const T &t) const
 Returns a point \( (1 - t)A + tB \). More...
 
double length () const
 Returns the length of the segment. More...
 
std::ostream & print (std::ostream &os) const
 Simple formatted print of a segment instance. More...
 

Member Typedef Documentation

◆ PointType

template<typename T, int NDIMS>
typedef Point<T, NDIMS> axom::primal::Segment< T, NDIMS >::PointType

Constructor & Destructor Documentation

◆ Segment()

template<typename T , int NDIMS>
axom::primal::Segment< T, NDIMS >::Segment ( const PointType A,
const PointType B 
)

Creates a segment instance from point A to point B.

Parameters
Auser-supplied source point
Buser-supplied target point

◆ ~Segment()

template<typename T , int NDIMS>
axom::primal::Segment< T, NDIMS >::~Segment ( )

Destructor.

Member Function Documentation

◆ source()

template<typename T, int NDIMS>
const PointType& axom::primal::Segment< T, NDIMS >::source ( ) const
inline

Returns the source point of the segment.

Returns
s the source point of the segment.

Referenced by axom::primal::orientation(), axom::primal::Ray< T, NDIMS >::Ray(), and axom::primal::squared_distance().

◆ target()

template<typename T, int NDIMS>
const PointType& axom::primal::Segment< T, NDIMS >::target ( ) const
inline

Returns the target point of the segment.

Returns
t the target point of the segment.

Referenced by axom::primal::orientation(), axom::primal::Ray< T, NDIMS >::Ray(), and axom::primal::squared_distance().

◆ at()

template<typename T, int NDIMS>
PointType axom::primal::Segment< T, NDIMS >::at ( const T &  t) const
inline

Returns a point \( (1 - t)A + tB \).

Parameters
[in]tuser-supplied parameter for blending A and B
Postcondition
Return point P will always be collinear with the segment's start point A and end point B.
If \( t = 0, \) the return point \( P = A. \)
If \( t = 1, \) the return point \( P = B. \)

References axom::primal::Point< T, NDIMS >::lerp().

◆ length()

template<typename T, int NDIMS>
double axom::primal::Segment< T, NDIMS >::length ( ) const
inline

Returns the length of the segment.

References axom::primal::Vector< T, NDIMS >::norm().

◆ print()

template<typename T, int NDIMS>
std::ostream& axom::primal::Segment< T, NDIMS >::print ( std::ostream &  os) const
inline

Simple formatted print of a segment instance.

Parameters
osThe output stream to write to
Returns
A reference to the modified ostream

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