Library of Assembled Shared Sources
lass::prim::LineSegment2D< T, ParameterPolicy > Class Template Reference

2D Line Segment More...

#include <line_segment_2d.h>

Inheritance diagram for lass::prim::LineSegment2D< T, ParameterPolicy >:

Public Member Functions

const TPoint point (TParam t) const
 Return point on ray by it's parameter.
 
const TValue t (const TPoint &point) const
 Return parameter of projection of iPoint on line segment.
 
const TVector vector () const
 Return vector from tail to head.
 
const TValue length () const
 Return length of line segment.
 

Related Symbols

(Note that these are not member symbols.)

template<typename T, class PPa, class PPb>
Result intersect (const LineSegment2D< T, PPa > &a, const LineSegment2D< T, PPb > &b, T &tA, T &tB)
 intersection of two line segments
 

Detailed Description

template<typename T, class ParameterPolicy = Bounded>
class lass::prim::LineSegment2D< T, ParameterPolicy >

2D Line Segment

Author
Bram de Greve [BdG]
Date
2003

Definition at line 74 of file line_segment_2d.h.

Member Function Documentation

◆ point()

template<typename T, class PP>
const LineSegment2D< T, PP >::TPoint lass::prim::LineSegment2D< T, PP >::point ( TParam t) const

Return point on ray by it's parameter.

Returns
origin + t * direction

Definition at line 116 of file line_segment_2d.inl.

References point(), t(), and vector().

Referenced by lass::prim::Line2D< T, EquationPolicy, NormalizingPolicy >::intersect(), point(), and t().

◆ t()

template<typename T, class PP>
const LineSegment2D< T, PP >::TValue lass::prim::LineSegment2D< T, PP >::t ( const TPoint & point) const

Return parameter of projection of iPoint on line segment.

Warning
the result can be out of bound [0, 1] regardless the parameter policy used.

Definition at line 129 of file line_segment_2d.inl.

References point(), t(), and vector().

Referenced by intersect(), point(), and t().

Friends And Related Symbol Documentation

◆ intersect()

template<typename T, class PPa, class PPb>
Result intersect ( const LineSegment2D< T, PPa > & a,
const LineSegment2D< T, PPb > & b,
T & tA,
T & tB )
related

intersection of two line segments

Parameters
a[in] line segment A
b[in] line segment B
aT[out] parameter of intersection point on line segment A
bT[out] parameter of intersection point on line segment B
Returns
  • rNone the line segments don't intersect, they have no points in common. tA and tB are not assigned.
  • rOne both line segments have exactly one point in common. tA and tB contain parameters of intersection point.
  • rInfinite the line segments have more than one point in common, they overlap. tA and tB are not assigned.

Definition at line 208 of file line_segment_2d.inl.


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