Library of Assembled Shared Sources
lass::prim::impl::Line2DCartesian< T, NormalizingPolicy > Class Template Reference

implementation of 2d line with both cartesian and parametric equation. More...

#include <line_2d_cartesian.h>

Inheritance diagram for lass::prim::impl::Line2DCartesian< T, NormalizingPolicy >:

Public Member Functions

 Line2DCartesian ()
 initializes to an invalid state.
 
 Line2DCartesian (const TPoint &iSupport, const TPoint &iPoint)
 Construct a line through three points.
 
 Line2DCartesian (const TPoint &iSupport, const TVector &iDirection)
 construct a line through a support point and by two direction vectors.
 
 Line2DCartesian (const TVector &iNormal, const TPoint &iSupport)
 Construct a line through a support point and by a normal vector.
 
 Line2DCartesian (const TVector &iNormal, TParam iD)
 Construct a line by a cartesian equation N.P + d == 0.
 
const TPoint support () const
 return generated support point.
 
const TVector direction () const
 return generated direction vector.
 
const TValue equation (const TPoint &iPoint) const
 Return value of point in equation.
 
const TValue equation (const TPoint &iPoint, TParam iRelativeTolerance) const
 Return value of point in equation, snapped to zero by iRelativeTolerance.
 
const TVector reject (const TPoint &iPoint) const
 return the vector that, if added to the PROJECTION of iPoint, you get iPoint again.
 
const TVector reject (const TVector &iVector) const
 return the part of iVector that is orthogonal to the line.
 
const TPoint project (const TPoint &iPoint) const
 project a point orthogonally onto the line
 
const TVector project (const TVector &iVector) const
 project a vector orthogonally onto the line
 
const TPoint reflect (const TPoint &iPoint) const
 reflect a point orthogonally into the line.
 
const TVector reflect (const TVector &iVector) const
 reflect a vector orthogonally into the line
 
const TPoint point (TParam iT) const
 return point by filling in parameter in generated parametric equation
 
const TValue t (const TPoint &iPoint) const
 return parameter along generated paremetric equation.
 
bool isValid () const
 return true if line is a valid line (no normal or direction vectors that are zero).
 

Detailed Description

template<typename T, class NormalizingPolicy = Normalized>
class lass::prim::impl::Line2DCartesian< T, NormalizingPolicy >

implementation of 2d line with both cartesian and parametric equation.

Author
Bram de Greve [BdG]

Definition at line 65 of file line_2d_cartesian.h.

Constructor & Destructor Documentation

◆ Line2DCartesian() [1/4]

template<typename T, class NP>
lass::prim::impl::Line2DCartesian< T, NP >::Line2DCartesian ( const TPoint & iSupport,
const TPoint & iPoint )

Construct a line through three points.

  • support point S is given by the first point iSupport.
  • direction vector U is choosen from iSupport to iPointU and iPointV respectively (U = iPoint - iSupport).
  • normal vector N is given by the perp of U.
  • value d is choosen so that the support point is indeed a point of the line.

Definition at line 80 of file line_2d_cartesian.inl.

◆ Line2DCartesian() [2/4]

template<typename T, class NP>
lass::prim::impl::Line2DCartesian< T, NP >::Line2DCartesian ( const TPoint & iSupport,
const TVector & iDirection )

construct a line through a support point and by two direction vectors.

  • support point S is given by the point iSupport.
  • direction vector U is given by iDir.
  • normal vector N is given by the perp of N.
  • value d is choosen so that the support point is indeed a point of the line.

Definition at line 96 of file line_2d_cartesian.inl.

◆ Line2DCartesian() [3/4]

template<typename T, class NP>
lass::prim::impl::Line2DCartesian< T, NP >::Line2DCartesian ( const TVector & iNormal,
const TPoint & iSupport )

Construct a line through a support point and by a normal vector.

  • support point S is given by the point iSupport.
  • normal vector N is given by the vector iNormal.
  • direction vector U is automatically generated so that N is perp of U.
  • value d is choosen so that the support point is indeed a point of the line.

Definition at line 112 of file line_2d_cartesian.inl.

◆ Line2DCartesian() [4/4]

template<typename T, class NP>
lass::prim::impl::Line2DCartesian< T, NP >::Line2DCartesian ( const TVector & iNormal,
TParam iD )

Construct a line by a cartesian equation N.P + d == 0.

  • normal vector N is given by the vector iNormal.
  • value d is given by the value iD.
  • support point S automatically generated so that N.S + d == 0.
  • direction vector U is automatically generated so that N is perp of U.

Definition at line 128 of file line_2d_cartesian.inl.

Member Function Documentation

◆ support()

template<typename T, class NP>
const Line2DCartesian< T, NP >::TPoint lass::prim::impl::Line2DCartesian< T, NP >::support ( ) const

◆ reject() [1/2]

template<typename T, class NP>
const Line2DCartesian< T, NP >::TVector lass::prim::impl::Line2DCartesian< T, NP >::reject ( const TPoint & iPoint) const

return the vector that, if added to the PROJECTION of iPoint, you get iPoint again.

iPoint == (almost) project(iPoint) + reject(iPoint)

Definition at line 211 of file line_2d_cartesian.inl.

References equation().

Referenced by project(), project(), reflect(), and reflect().

◆ reject() [2/2]

template<typename T, class NP>
const Line2DCartesian< T, NP >::TVector lass::prim::impl::Line2DCartesian< T, NP >::reject ( const TVector & iVector) const

return the part of iVector that is orthogonal to the line.

it's the vector that, if added to the PROJECTION of iVector, you get iVector again. iVector == (almost) project(iVector) + reject(iVector).

Definition at line 224 of file line_2d_cartesian.inl.


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