OSVR-Core
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Eigen::Hyperplane< _Scalar, _AmbientDim > Class Template Reference

More...

#include <Hyperplane.h>

Public Types

enum  { AmbientDimAtCompileTime = _AmbientDim }
 
enum  { AmbientDimAtCompileTime = _AmbientDim, Options = _Options }
 
typedef _Scalar Scalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
 
typedef Matrix< Scalar, int(AmbientDimAtCompileTime)==Dynamic ? Dynamic :int(AmbientDimAtCompileTime)+1, 1 > Coefficients
 
typedef Block< Coefficients, AmbientDimAtCompileTime, 1 > NormalReturnType
 
typedef _Scalar Scalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef DenseIndex Index
 
typedef Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
 
typedef Matrix< Scalar, Index(AmbientDimAtCompileTime)==Dynamic ? Dynamic :Index(AmbientDimAtCompileTime)+1, 1, OptionsCoefficients
 
typedef Block< Coefficients, AmbientDimAtCompileTime, 1 > NormalReturnType
 
typedef const Block< const Coefficients, AmbientDimAtCompileTime, 1 > ConstNormalReturnType
 

Public Member Functions

 Hyperplane ()
 Default constructor without initialization.
 
 Hyperplane (int _dim)
 Constructs a dynamic-size hyperplane with _dim the dimension of the ambient space.
 
 Hyperplane (const VectorType &n, const VectorType &e)
 Construct a plane from its normal n and a point e onto the plane. More...
 
 Hyperplane (const VectorType &n, Scalar d)
 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 \). More...
 
 Hyperplane (const ParametrizedLine< Scalar, AmbientDimAtCompileTime > &parametrized)
 Constructs a hyperplane passing through the parametrized line parametrized. More...
 
int dim () const
 
void normalize (void)
 normalizes *this
 
Scalar signedDistance (const VectorType &p) const
 
Scalar absDistance (const VectorType &p) const
 
VectorType projection (const VectorType &p) const
 
const NormalReturnType normal () const
 
NormalReturnType normal ()
 
const Scalar & offset () const
 
Scalar & offset ()
 
const Coefficientscoeffs () const
 
Coefficientscoeffs ()
 
VectorType intersection (const Hyperplane &other)
 
template<typename XprType >
Hyperplanetransform (const MatrixBase< XprType > &mat, TransformTraits traits=Affine)
 Applies the transformation matrix mat to *this and returns a reference to *this. More...
 
Hyperplanetransform (const Transform< Scalar, AmbientDimAtCompileTime > &t, TransformTraits traits=Affine)
 Applies the transformation t to *this and returns a reference to *this. More...
 
template<typename NewScalarType >
internal::cast_return_type< Hyperplane, Hyperplane< NewScalarType, AmbientDimAtCompileTime > >::type cast () const
 
template<typename OtherScalarType >
 Hyperplane (const Hyperplane< OtherScalarType, AmbientDimAtCompileTime > &other)
 Copy constructor with scalar type conversion.
 
bool isApprox (const Hyperplane &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
 
 Hyperplane ()
 Default constructor without initialization.
 
template<int OtherOptions>
 Hyperplane (const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &other)
 
 Hyperplane (Index _dim)
 Constructs a dynamic-size hyperplane with _dim the dimension of the ambient space.
 
 Hyperplane (const VectorType &n, const VectorType &e)
 Construct a plane from its normal n and a point e onto the plane. More...
 
 Hyperplane (const VectorType &n, const Scalar &d)
 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 \). More...
 
 Hyperplane (const ParametrizedLine< Scalar, AmbientDimAtCompileTime > &parametrized)
 Constructs a hyperplane passing through the parametrized line parametrized. More...
 
Index dim () const
 
void normalize (void)
 normalizes *this
 
Scalar signedDistance (const VectorType &p) const
 
Scalar absDistance (const VectorType &p) const
 
VectorType projection (const VectorType &p) const
 
ConstNormalReturnType normal () const
 
NormalReturnType normal ()
 
const Scalar & offset () const
 
Scalar & offset ()
 
const Coefficientscoeffs () const
 
Coefficientscoeffs ()
 
VectorType intersection (const Hyperplane &other) const
 
template<typename XprType >
Hyperplanetransform (const MatrixBase< XprType > &mat, TransformTraits traits=Affine)
 Applies the transformation matrix mat to *this and returns a reference to *this. More...
 
template<int TrOptions>
Hyperplanetransform (const Transform< Scalar, AmbientDimAtCompileTime, Affine, TrOptions > &t, TransformTraits traits=Affine)
 Applies the transformation t to *this and returns a reference to *this. More...
 
template<typename NewScalarType >
internal::cast_return_type< Hyperplane, Hyperplane< NewScalarType, AmbientDimAtCompileTime, Options > >::type cast () const
 
template<typename OtherScalarType , int OtherOptions>
 Hyperplane (const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &other)
 Copy constructor with scalar type conversion.
 
template<int OtherOptions>
bool isApprox (const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
 

Static Public Member Functions

static Hyperplane Through (const VectorType &p0, const VectorType &p1)
 Constructs a hyperplane passing through the two points. More...
 
static Hyperplane Through (const VectorType &p0, const VectorType &p1, const VectorType &p2)
 Constructs a hyperplane passing through the three points. More...
 
static Hyperplane Through (const VectorType &p0, const VectorType &p1)
 Constructs a hyperplane passing through the two points. More...
 
static Hyperplane Through (const VectorType &p0, const VectorType &p1, const VectorType &p2)
 Constructs a hyperplane passing through the three points. More...
 

Protected Attributes

Coefficients m_coeffs
 

Detailed Description

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

A hyperplane

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.

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.

Constructor & Destructor Documentation

§ Hyperplane() [1/6]

template<typename _Scalar, int _AmbientDim>
Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ Hyperplane() [2/6]

template<typename _Scalar, int _AmbientDim>
Eigen::Hyperplane< _Scalar, _AmbientDim >::Hyperplane ( const VectorType n,
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.

§ Hyperplane() [3/6]

template<typename _Scalar, int _AmbientDim>
Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ Hyperplane() [4/6]

template<typename _Scalar, int _AmbientDim>
Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ Hyperplane() [5/6]

template<typename _Scalar, int _AmbientDim>
Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ Hyperplane() [6/6]

template<typename _Scalar, int _AmbientDim>
Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

Member Function Documentation

§ absDistance() [1/2]

template<typename _Scalar, int _AmbientDim>
Scalar Eigen::Hyperplane< _Scalar, _AmbientDim >::absDistance ( const VectorType p) const
inline
Returns
the absolute distance between the plane *this and a point p.
See also
signedDistance()

§ absDistance() [2/2]

template<typename _Scalar, int _AmbientDim>
Scalar Eigen::Hyperplane< _Scalar, _AmbientDim >::absDistance ( const VectorType p) const
inline
Returns
the absolute distance between the plane *this and a point p.
See also
signedDistance()

§ cast() [1/2]

template<typename _Scalar, int _AmbientDim>
template<typename NewScalarType >
internal::cast_return_type<Hyperplane, Hyperplane<NewScalarType,AmbientDimAtCompileTime> >::type Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ cast() [2/2]

template<typename _Scalar, int _AmbientDim>
template<typename NewScalarType >
internal::cast_return_type<Hyperplane, Hyperplane<NewScalarType,AmbientDimAtCompileTime,Options> >::type Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ coeffs() [1/4]

template<typename _Scalar, int _AmbientDim>
const Coefficients& Eigen::Hyperplane< _Scalar, _AmbientDim >::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 \)

§ coeffs() [2/4]

template<typename _Scalar, int _AmbientDim>
Coefficients& Eigen::Hyperplane< _Scalar, _AmbientDim >::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 \)

§ coeffs() [3/4]

template<typename _Scalar, int _AmbientDim>
const Coefficients& Eigen::Hyperplane< _Scalar, _AmbientDim >::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 \)

§ coeffs() [4/4]

template<typename _Scalar, int _AmbientDim>
Coefficients& Eigen::Hyperplane< _Scalar, _AmbientDim >::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 \)

§ dim() [1/2]

template<typename _Scalar, int _AmbientDim>
int Eigen::Hyperplane< _Scalar, _AmbientDim >::dim ( ) const
inline
Returns
the dimension in which the plane holds

§ dim() [2/2]

template<typename _Scalar, int _AmbientDim>
Index Eigen::Hyperplane< _Scalar, _AmbientDim >::dim ( ) const
inline
Returns
the dimension in which the plane holds

§ intersection() [1/2]

template<typename _Scalar, int _AmbientDim>
VectorType Eigen::Hyperplane< _Scalar, _AmbientDim >::intersection ( const Hyperplane< _Scalar, _AmbientDim > &  other)
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.

§ intersection() [2/2]

template<typename _Scalar, int _AmbientDim>
VectorType Eigen::Hyperplane< _Scalar, _AmbientDim >::intersection ( const Hyperplane< _Scalar, _AmbientDim > &  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.

§ isApprox() [1/2]

template<typename _Scalar, int _AmbientDim>
bool Eigen::Hyperplane< _Scalar, _AmbientDim >::isApprox ( const Hyperplane< _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()

§ isApprox() [2/2]

template<typename _Scalar, int _AmbientDim>
template<int OtherOptions>
bool Eigen::Hyperplane< _Scalar, _AmbientDim >::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()

§ normal() [1/4]

template<typename _Scalar, int _AmbientDim>
const NormalReturnType Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ normal() [2/4]

template<typename _Scalar, int _AmbientDim>
NormalReturnType Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ normal() [3/4]

template<typename _Scalar, int _AmbientDim>
ConstNormalReturnType Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ normal() [4/4]

template<typename _Scalar, int _AmbientDim>
NormalReturnType Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ offset() [1/4]

template<typename _Scalar, int _AmbientDim>
const Scalar& Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ offset() [2/4]

template<typename _Scalar, int _AmbientDim>
Scalar& Eigen::Hyperplane< _Scalar, _AmbientDim >::offset ( )
inline
Returns
a non-constant reference to the distance to the origin, which is also the constant part of the implicit equation

§ offset() [3/4]

template<typename _Scalar, int _AmbientDim>
const Scalar& Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ offset() [4/4]

template<typename _Scalar, int _AmbientDim>
Scalar& Eigen::Hyperplane< _Scalar, _AmbientDim >::offset ( )
inline
Returns
a non-constant reference to the distance to the origin, which is also the constant part of the implicit equation

§ projection() [1/2]

template<typename _Scalar, int _AmbientDim>
VectorType Eigen::Hyperplane< _Scalar, _AmbientDim >::projection ( const VectorType p) const
inline
Returns
the projection of a point p onto the plane *this.

§ projection() [2/2]

template<typename _Scalar, int _AmbientDim>
VectorType Eigen::Hyperplane< _Scalar, _AmbientDim >::projection ( const VectorType p) const
inline
Returns
the projection of a point p onto the plane *this.

§ signedDistance() [1/2]

template<typename _Scalar, int _AmbientDim>
Scalar Eigen::Hyperplane< _Scalar, _AmbientDim >::signedDistance ( const VectorType p) const
inline
Returns
the signed distance between the plane *this and a point p.
See also
absDistance()

§ signedDistance() [2/2]

template<typename _Scalar, int _AmbientDim>
Scalar Eigen::Hyperplane< _Scalar, _AmbientDim >::signedDistance ( const VectorType p) const
inline
Returns
the signed distance between the plane *this and a point p.
See also
absDistance()

§ Through() [1/4]

template<typename _Scalar, int _AmbientDim>
static Hyperplane Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ Through() [2/4]

template<typename _Scalar, int _AmbientDim>
static Hyperplane Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ Through() [3/4]

template<typename _Scalar, int _AmbientDim>
static Hyperplane Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ Through() [4/4]

template<typename _Scalar, int _AmbientDim>
static Hyperplane Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ transform() [1/4]

template<typename _Scalar, int _AmbientDim>
template<typename XprType >
Hyperplane& Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ transform() [2/4]

template<typename _Scalar, int _AmbientDim>
Hyperplane& Eigen::Hyperplane< _Scalar, _AmbientDim >::transform ( const Transform< Scalar, AmbientDimAtCompileTime > &  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.

§ transform() [3/4]

template<typename _Scalar, int _AmbientDim>
template<typename XprType >
Hyperplane& Eigen::Hyperplane< _Scalar, _AmbientDim >::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.

§ transform() [4/4]

template<typename _Scalar, int _AmbientDim>
template<int TrOptions>
Hyperplane& Eigen::Hyperplane< _Scalar, _AmbientDim >::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 file: