Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ParametrizedLine< _Scalar, _AmbientDim > Class Template Reference

A parametrized line. More...

Public Types

enum  { AmbientDimAtCompileTime }
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef _Scalar Scalar
 
typedef Matrix< Scalar,
AmbientDimAtCompileTime, 1 > 
VectorType
 

Public Member Functions

template<typename NewScalarType >
ei_cast_return_type
< ParametrizedLine,
ParametrizedLine
< NewScalarType,
AmbientDimAtCompileTime >
>::type 
cast () const
 
int dim () const
 
const VectorTypedirection () const
 
VectorTypedirection ()
 
RealScalar distance (const VectorType &p) const
 
Scalar intersection (const Hyperplane< _Scalar, _AmbientDim > &hyperplane)
 
bool isApprox (const ParametrizedLine &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
 
const VectorTypeorigin () const
 
VectorTypeorigin ()
 
 ParametrizedLine ()
 
 ParametrizedLine (int _dim)
 
 ParametrizedLine (const VectorType &origin, const VectorType &direction)
 
 ParametrizedLine (const Hyperplane< _Scalar, _AmbientDim > &hyperplane)
 
template<typename OtherScalarType >
 ParametrizedLine (const ParametrizedLine< OtherScalarType, AmbientDimAtCompileTime > &other)
 
VectorType projection (const VectorType &p) const
 
RealScalar squaredDistance (const VectorType &p) const
 

Static Public Member Functions

static ParametrizedLine Through (const VectorType &p0, const VectorType &p1)
 

Protected Attributes

VectorType m_direction
 
VectorType m_origin
 

Detailed Description

template<typename _Scalar, int _AmbientDim>
class Eigen::ParametrizedLine< _Scalar, _AmbientDim >

A parametrized line.

This is defined in the Geometry module.

#include <Eigen/Geometry>

A parametrized line is defined by an origin point $ \mathbf{o} $ and a unit direction vector $ \mathbf{d} $ such that the line corresponds to the set $ l(t) = \mathbf{o} + t \mathbf{d} $, $ t \in \mathbf{R} $.

Parameters
_Scalarthe scalar type, i.e., the type of the coefficients
_AmbientDimthe dimension of the ambient space, can be a compile time value or Dynamic.

Constructor & Destructor Documentation

ParametrizedLine ( )
inlineexplicit

Default constructor without initialization

ParametrizedLine ( int  _dim)
inlineexplicit

Constructs a dynamic-size line with _dim the dimension of the ambient space

ParametrizedLine ( const VectorType origin,
const VectorType direction 
)
inline

Initializes a parametrized line of direction direction and origin origin.

Warning
the vector direction is assumed to be normalized.
ParametrizedLine ( const Hyperplane< _Scalar, _AmbientDim > &  hyperplane)
inlineexplicit

Constructs a parametrized line from a 2D hyperplane

Warning
the ambient space must have dimension 2 such that the hyperplane actually describes a line
ParametrizedLine ( const ParametrizedLine< OtherScalarType, AmbientDimAtCompileTime > &  other)
inlineexplicit

Copy constructor with scalar type conversion

Member Function Documentation

ei_cast_return_type<ParametrizedLine, ParametrizedLine<NewScalarType,AmbientDimAtCompileTime> >::type cast ( ) const
inline
Returns
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

int dim ( ) const
inline
Returns
the dimension in which the line holds
RealScalar distance ( const VectorType p) const
inline
Returns
the distance of a point p to its projection onto the line *this.
See also
squaredDistance()
_Scalar intersection ( const Hyperplane< _Scalar, _AmbientDim > &  hyperplane)
inline
Returns
the parameter value of the intersection between *this and the given hyperplane
bool isApprox ( const ParametrizedLine< _Scalar, _AmbientDim > &  other,
typename NumTraits< Scalar >::Real  prec = precision<Scalar>() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See also
MatrixBase::isApprox()
VectorType projection ( const VectorType p) const
inline
Returns
the projection of a point p onto the line *this.
RealScalar squaredDistance ( const VectorType p) const
inline
Returns
the squared distance of a point p to its projection onto the line *this.
See also
distance()
static ParametrizedLine Through ( const VectorType p0,
const VectorType p1 
)
inlinestatic

Constructs a parametrized line going from p0 to p1.


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