Eigen  3.3.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Eigen::Hyperplane< _Scalar, _AmbientDim, Options > Class Template Reference

Detailed Description

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
class Eigen::Hyperplane< _Scalar, _AmbientDim, Options >

A hyperplane.

This is defined in the Geometry module.

#include <Eigen/Geometry>

A hyperplane is an affine subspace of dimension n-1 in a space of dimension n. For example, a hyperplane in a plane is a line; a hyperplane in 3-space is a plane.

Template 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. Notice that the dimension of the hyperplane is _AmbientDim-1.

This class represents an hyperplane as the zero set of the implicit equation $ n \cdot x + d = 0 $ where $ n $ is a unit normal vector of the plane (linear part) and $ d $ is the distance (offset) to the origin.

Public Types

typedef Eigen::Index Index
 

Public Member Functions

Scalar absDistance (const VectorType &p) const
 
template<typename NewScalarType >
internal::cast_return_type
< Hyperplane, Hyperplane
< NewScalarType,
AmbientDimAtCompileTime,
Options > >::type 
cast () const
 
const Coefficientscoeffs () const
 
Coefficientscoeffs ()
 
Index dim () const
 
 Hyperplane ()
 
 Hyperplane (Index _dim)
 
 Hyperplane (const VectorType &n, const VectorType &e)
 
 Hyperplane (const VectorType &n, const Scalar &d)
 
 Hyperplane (const ParametrizedLine< Scalar, AmbientDimAtCompileTime > &parametrized)
 
template<typename OtherScalarType , int OtherOptions>
 Hyperplane (const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &other)
 
VectorType intersection (const Hyperplane &other) const
 
template<int OtherOptions>
bool isApprox (const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 
ConstNormalReturnType normal () const
 
NormalReturnType normal ()
 
void normalize (void)
 
const Scalar & offset () const
 
Scalar & offset ()
 
VectorType projection (const VectorType &p) const
 
Scalar signedDistance (const VectorType &p) const
 
template<typename XprType >
Hyperplanetransform (const MatrixBase< XprType > &mat, TransformTraits traits=Affine)
 
template<int TrOptions>
Hyperplanetransform (const Transform< Scalar, AmbientDimAtCompileTime, Affine, TrOptions > &t, TransformTraits traits=Affine)
 

Static Public Member Functions

static Hyperplane Through (const VectorType &p0, const VectorType &p1)
 
static Hyperplane Through (const VectorType &p0, const VectorType &p1, const VectorType &p2)
 

Member Typedef Documentation

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
typedef Eigen::Index Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::Index
Deprecated:
since Eigen 3.3

Constructor & Destructor Documentation

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::Hyperplane ( )
inline

Default constructor without initialization

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::Hyperplane ( Index  _dim)
inlineexplicit

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

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::Hyperplane ( const VectorType n,
const VectorType e 
)
inline

Construct a plane from its normal n and a point e onto the plane.

Warning
the vector normal is assumed to be normalized.
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::Hyperplane ( const VectorType n,
const Scalar &  d 
)
inline

Constructs a plane from its normal n and distance to the origin d such that the algebraic equation of the plane is $ n \cdot x + d = 0 $.

Warning
the vector normal is assumed to be normalized.
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::Hyperplane ( const ParametrizedLine< Scalar, AmbientDimAtCompileTime > &  parametrized)
inlineexplicit

Constructs a hyperplane passing through the parametrized line parametrized. If the dimension of the ambient space is greater than 2, then there isn't uniqueness, so an arbitrary choice is made.

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
template<typename OtherScalarType , int OtherOptions>
Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::Hyperplane ( const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &  other)
inlineexplicit

Copy constructor with scalar type conversion

Member Function Documentation

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Scalar Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::absDistance ( const VectorType p) const
inline
Returns
the absolute distance between the plane *this and a point p.
See Also
signedDistance()
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
template<typename NewScalarType >
internal::cast_return_type<Hyperplane, Hyperplane<NewScalarType,AmbientDimAtCompileTime,Options> >::type Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::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.

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
const Coefficients& Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::coeffs ( ) const
inline
Returns
a constant reference to the coefficients c_i of the plane equation: $ c_0*x_0 + ... + c_{d-1}*x_{d-1} + c_d = 0 $
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Coefficients& Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::coeffs ( )
inline
Returns
a non-constant reference to the coefficients c_i of the plane equation: $ c_0*x_0 + ... + c_{d-1}*x_{d-1} + c_d = 0 $
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Index Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::dim ( ) const
inline
Returns
the dimension in which the plane holds
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
VectorType Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::intersection ( const Hyperplane< _Scalar, _AmbientDim, Options > &  other) const
inline
Returns
the intersection of *this with other.
Warning
The ambient space must be a plane, i.e. have dimension 2, so that *this and other are lines.
Note
If other is approximately parallel to *this, this method will return any point on *this.
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
template<int OtherOptions>
bool Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::isApprox ( const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &  other,
const typename NumTraits< Scalar >::Real &  prec = NumTraits<Scalar>::dummy_precision() 
) const
inline
Returns
true if *this is approximately equal to other, within the precision determined by prec.
See Also
MatrixBase::isApprox()
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
ConstNormalReturnType Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::normal ( ) const
inline
Returns
a constant reference to the unit normal vector of the plane, which corresponds to the linear part of the implicit equation.
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
NormalReturnType Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::normal ( )
inline
Returns
a non-constant reference to the unit normal vector of the plane, which corresponds to the linear part of the implicit equation.
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
void Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::normalize ( void  )
inline

normalizes *this

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
const Scalar& Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::offset ( ) const
inline
Returns
the distance to the origin, which is also the "constant term" of the implicit equation
Warning
the vector normal is assumed to be normalized.
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Scalar& Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::offset ( )
inline
Returns
a non-constant reference to the distance to the origin, which is also the constant part of the implicit equation
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
VectorType Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::projection ( const VectorType p) const
inline
Returns
the projection of a point p onto the plane *this.
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
Scalar Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::signedDistance ( const VectorType p) const
inline
Returns
the signed distance between the plane *this and a point p.
See Also
absDistance()
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
static Hyperplane Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::Through ( const VectorType p0,
const VectorType p1 
)
inlinestatic

Constructs a hyperplane passing through the two points. If the dimension of the ambient space is greater than 2, then there isn't uniqueness, so an arbitrary choice is made.

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
static Hyperplane Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::Through ( const VectorType p0,
const VectorType p1,
const VectorType p2 
)
inlinestatic

Constructs a hyperplane passing through the three points. The dimension of the ambient space is required to be exactly 3.

template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
template<typename XprType >
Hyperplane& Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::transform ( const MatrixBase< XprType > &  mat,
TransformTraits  traits = Affine 
)
inline

Applies the transformation matrix mat to *this and returns a reference to *this.

Parameters
matthe Dim x Dim transformation matrix
traitsspecifies whether the matrix mat represents an Isometry or a more generic Affine transformation. The default is Affine.
template<typename _Scalar, int _AmbientDim, int Options = AutoAlign>
template<int TrOptions>
Hyperplane& Eigen::Hyperplane< _Scalar, _AmbientDim, Options >::transform ( const Transform< Scalar, AmbientDimAtCompileTime, Affine, TrOptions > &  t,
TransformTraits  traits = Affine 
)
inline

Applies the transformation t to *this and returns a reference to *this.

Parameters
tthe transformation of dimension Dim
traitsspecifies whether the transformation t represents an Isometry or a more generic Affine transformation. The default is Affine. Other kind of transformations are not supported.

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