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 VectorType & | direction () const |
VectorType & | direction () |
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 VectorType & | origin () const |
VectorType & | origin () |
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 |
A parametrized line.
This is defined in the Geometry module.
#include <Eigen/Geometry>
A parametrized line is defined by an origin point and a unit direction vector
such that the line corresponds to the set
,
.
_Scalar | the scalar type, i.e., the type of the coefficients |
_AmbientDim | the dimension of the ambient space, can be a compile time value or Dynamic. |
ParametrizedLine | ( | ) | [inline, explicit] |
Default constructor without initialization
ParametrizedLine | ( | int | _dim | ) | [inline, explicit] |
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.
ParametrizedLine | ( | const Hyperplane< _Scalar, _AmbientDim > & | hyperplane | ) | [inline, explicit] |
Constructs a parametrized line from a 2D hyperplane
ParametrizedLine | ( | const ParametrizedLine< OtherScalarType, AmbientDimAtCompileTime > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
ei_cast_return_type<ParametrizedLine, ParametrizedLine<NewScalarType,AmbientDimAtCompileTime> >::type cast | ( | ) | const [inline] |
*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] |
RealScalar distance | ( | const VectorType & | p | ) | const [inline] |
*this
. _Scalar intersection | ( | const Hyperplane< _Scalar, _AmbientDim > & | hyperplane | ) | [inline] |
*this
and the given hyperplane bool isApprox | ( | const ParametrizedLine< _Scalar, _AmbientDim > & | other, |
typename NumTraits< Scalar >::Real | prec = precision<Scalar>() |
||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.VectorType projection | ( | const VectorType & | p | ) | const [inline] |
*this
. RealScalar squaredDistance | ( | const VectorType & | p | ) | const [inline] |
*this
. static ParametrizedLine Through | ( | const VectorType & | p0, |
const VectorType & | p1 | ||
) | [inline, static] |
Constructs a parametrized line going from p0 to p1.