Thea

A straight line in Ndimensional space, where N is any positive (nonzero) integer and T is a field. More...
#include <LineSegmentN.hpp>
Public Types  
typedef LineSegmentN< N, T >  LineSegmentT 
Ndimensional straight line. More...  
Public Member Functions  
template<typename U >  
LineSegmentN< N, U >  cast () const 
Cast the line segment to a different scalar type. More...  
VectorT  closestPoint (VectorT const &p) const 
Get the point on the line closest to a given point. More...  
T  distance (VectorT const &p) const 
Get the distance of the line from a given point. More...  
T  distance (LineSegmentT const &other) const 
Get the distance of this segment from another segment. More...  
T  distance (LineN< N, T > const &line) const 
Get the distance of this segment from an infinite line. More...  
T  distance (RayN< N, T > const &ray) const 
Get the distance of this segment from a ray. More...  
AxisAlignedBoxN< N, T >  getBounds () const 
Get a bounding box for the line segment. More...  
VectorT const &  getDirection () const 
Get the unnormalized direction vector of the segment from the first endpoint to the second. More...  
VectorT  getEndpoint (int i) const 
Get an endpoint of the line segment: 0 returns the first endpoint and 1 returns the second. More...  
VectorT  getPoint (Real t) const 
Get a point on the line segment: t = 0 maps to the first endpoint and t = 1 maps to the second. More...  
T  length () const 
Get the length of the line segment. More...  
LineSegmentN ()  
Default constructor, does not initialize the segment. More...  
LineSegmentN (VectorT const &point1, VectorT const &point2)  
Construct the line segment from its endpoints. More...  
T  squaredDistance (VectorT const &p) const 
Get the square of the distance of the line from a given point. More...  
T  squaredDistance (LineSegmentT const &other, VectorT *this_pt=nullptr, VectorT *other_pt=nullptr) const 
Get the squared distance between this segment and another segment, and optionally return the closest pair of points. More...  
T  squaredDistance (LineN< N, T > const &line, VectorT *this_pt=nullptr, VectorT *line_pt=nullptr) const 
Get the squared distance between this segment and an infinite line, and optionally return the closest pair of points. More...  
T  squaredDistance (RayN< N, T > const &ray, VectorT *this_pt=nullptr, VectorT *ray_pt=nullptr) const 
Get the squared distance between this segment and a ray, and optionally return the closest pair of points. More...  
T  squaredLength () const 
Get the square of the length of the line segment. More...  
std::string  toString () const 
Get a textual representation of the line segment. More...  
Static Public Member Functions  
static LineSegmentT  fromPointAndDirection (VectorT const &point_, VectorT const &direction_) 
Construct the line segment from its first endpoint and its direction vector, with length equal to that of the segment. More...  
A straight line in Ndimensional space, where N is any positive (nonzero) integer and T is a field.
Definition at line 27 of file LineSegmentN.hpp.

inherited 
Ndimensional straight line.
Definition at line 48 of file LineSegmentN.hpp.
LineSegmentN  (  ) 
Default constructor, does not initialize the segment.
Definition at line 243 of file LineSegmentN.hpp.
LineSegmentN  (  VectorT const &  point1, 
VectorT const &  point2  
) 
Construct the line segment from its endpoints.
Definition at line 246 of file LineSegmentN.hpp.

inherited 
Cast the line segment to a different scalar type.
Definition at line 73 of file LineSegmentN.hpp.
Get the point on the line closest to a given point.
Definition at line 106 of file LineSegmentN.hpp.

inherited 
Get the distance of the line from a given point.
Definition at line 94 of file LineSegmentN.hpp.

inherited 
Get the distance of this segment from another segment.
Definition at line 147 of file LineSegmentN.hpp.

inherited 
Get the distance of this segment from an infinite line.
Definition at line 167 of file LineSegmentN.hpp.

inherited 
Get the distance of this segment from a ray.
Definition at line 187 of file LineSegmentN.hpp.

staticinherited 
Construct the line segment from its first endpoint and its direction vector, with length equal to that of the segment.
Definition at line 64 of file LineSegmentN.hpp.

inherited 
Get a bounding box for the line segment.
Definition at line 209 of file LineSegmentN.hpp.

inherited 
Get the unnormalized direction vector of the segment from the first endpoint to the second.
Definition at line 82 of file LineSegmentN.hpp.

inherited 
Get an endpoint of the line segment: 0 returns the first endpoint and 1 returns the second.
Definition at line 79 of file LineSegmentN.hpp.

inherited 
Get a point on the line segment: t = 0 maps to the first endpoint and t = 1 maps to the second.
Definition at line 85 of file LineSegmentN.hpp.

inherited 
Get the length of the line segment.
Definition at line 88 of file LineSegmentN.hpp.

inherited 
Get the square of the distance of the line from a given point.
Definition at line 100 of file LineSegmentN.hpp.

inherited 
Get the squared distance between this segment and another segment, and optionally return the closest pair of points.
Definition at line 153 of file LineSegmentN.hpp.

inherited 
Get the squared distance between this segment and an infinite line, and optionally return the closest pair of points.
Definition at line 173 of file LineSegmentN.hpp.

inherited 
Get the squared distance between this segment and a ray, and optionally return the closest pair of points.
Definition at line 193 of file LineSegmentN.hpp.

inherited 
Get the square of the length of the line segment.
Definition at line 91 of file LineSegmentN.hpp.

inherited 
Get a textual representation of the line segment.
Definition at line 217 of file LineSegmentN.hpp.