MeshLib Documentation
Loading...
Searching...
No Matches
MR::Line< V > Struct Template Reference

#include <MRLine.h>

Public Types

using T = typename V::ValueType
 

Public Member Functions

constexpr Line () noexcept=default
 
constexpr Line (const V &p, const V &d) noexcept
 
template<typename U >
constexpr Line (const Line< U > &l) noexcept
 
operator() (T param) const
 returns point on the line, where param=0 returns p and param=1 returns p+d
 
T distanceSq (const V &x) const
 returns squared distance from given point to this line
 
Line operator- () const
 returns same line represented with flipped direction of d-vector
 
const Lineoperator+ () const
 returns same representation
 
Line normalized () const
 returns same line represented with unit d-vector
 
project (const V &x) const
 finds the closest point on line
 

Public Attributes

p
 
d
 

Related Symbols

(Note that these are not member symbols.)

template<typename V >
Line< V > transformed (const Line< V > &l, const AffineXf< V > &xf)
 

Detailed Description

template<typename V>
struct MR::Line< V >

2- or 3-dimensional line: cross( x - p, d ) = 0

Member Typedef Documentation

◆ T

template<typename V >
using MR::Line< V >::T = typename V::ValueType

Constructor & Destructor Documentation

◆ Line() [1/3]

template<typename V >
MR::Line< V >::Line ( )
constexprdefaultnoexcept

◆ Line() [2/3]

template<typename V >
MR::Line< V >::Line ( const V & p,
const V & d )
inlineconstexprnoexcept

◆ Line() [3/3]

template<typename V >
template<typename U >
MR::Line< V >::Line ( const Line< U > & l)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ distanceSq()

template<typename V >
T MR::Line< V >::distanceSq ( const V & x) const
inlinenodiscard

returns squared distance from given point to this line

◆ normalized()

template<typename V >
Line MR::Line< V >::normalized ( ) const
inlinenodiscard

returns same line represented with unit d-vector

◆ operator()()

template<typename V >
V MR::Line< V >::operator() ( T param) const
inlinenodiscard

returns point on the line, where param=0 returns p and param=1 returns p+d

◆ operator+()

template<typename V >
const Line & MR::Line< V >::operator+ ( ) const
inlinenodiscard

returns same representation

◆ operator-()

template<typename V >
Line MR::Line< V >::operator- ( ) const
inlinenodiscard

returns same line represented with flipped direction of d-vector

◆ project()

template<typename V >
V MR::Line< V >::project ( const V & x) const
inlinenodiscard

finds the closest point on line

Friends And Related Symbol Documentation

◆ transformed()

template<typename V >
Line< V > transformed ( const Line< V > & l,
const AffineXf< V > & xf )
related

given line: l(x) = 0, and transformation: y=xf(x);

Returns
the same line in y reference frame: l'(y) = 0;

if given transformation is not rigid, then it is a good idea to normalize returned line

Member Data Documentation

◆ d

template<typename V >
V MR::Line< V >::d

◆ p

template<typename V >
V MR::Line< V >::p

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