Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
Eigen::Hyperplane Class Reference

Detailed Description

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.

List of all members.

Public Types

enum  { AmbientDimAtCompileTime = _AmbientDim, Options = _Options }
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, Options > 
Coefficients
typedef Block< Coefficients,
AmbientDimAtCompileTime, 1 > 
NormalReturnType
typedef const Block< const
Coefficients,
AmbientDimAtCompileTime, 1 > 
ConstNormalReturnType

Public Member Functions

 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.
 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 $.
 Hyperplane (const ParametrizedLine< Scalar, AmbientDimAtCompileTime > &parametrized)
 Constructs a hyperplane passing through the parametrized line parametrized.
 ~Hyperplane ()
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 Scalaroffset () const
Scalaroffset ()
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.
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.
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, 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.
static Hyperplane Through (const VectorType &p0, const VectorType &p1, const VectorType &p2)
 Constructs a hyperplane passing through the three points.

Protected Attributes

Coefficients m_coeffs

Member Typedef Documentation

typedef Matrix<Scalar,Index(AmbientDimAtCompileTime)==Dynamic ? Dynamic : Index(AmbientDimAtCompileTime)+1,1,Options> Eigen::Hyperplane::Coefficients

Definition at line 62 of file Geometry.

typedef const Block<const Coefficients,AmbientDimAtCompileTime,1> Eigen::Hyperplane::ConstNormalReturnType

Definition at line 64 of file Geometry.

Definition at line 58 of file Geometry.

typedef Block<Coefficients,AmbientDimAtCompileTime,1> Eigen::Hyperplane::NormalReturnType

Definition at line 63 of file Geometry.

Definition at line 57 of file Geometry.

typedef _Scalar Eigen::Hyperplane::Scalar

Definition at line 56 of file Geometry.

typedef Matrix<Scalar,AmbientDimAtCompileTime,1> Eigen::Hyperplane::VectorType

Definition at line 59 of file Geometry.


Member Enumeration Documentation

anonymous enum
Enumerator:
AmbientDimAtCompileTime 
Options 

Definition at line 52 of file Geometry.


Constructor & Destructor Documentation

Eigen::Hyperplane::Hyperplane ( ) [inline, explicit]

Default constructor without initialization.

Definition at line 67 of file Geometry.

template<int OtherOptions>
Eigen::Hyperplane::Hyperplane ( const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &  other) [inline]

Definition at line 70 of file Geometry.

Eigen::Hyperplane::Hyperplane ( Index  _dim) [inline, explicit]

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

Definition at line 76 of file Geometry.

Eigen::Hyperplane::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.

Definition at line 81 of file Geometry.

Eigen::Hyperplane::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.

Definition at line 92 of file Geometry.

Eigen::Hyperplane::Hyperplane ( const ParametrizedLine< Scalar, AmbientDimAtCompileTime > &  parametrized) [inline, explicit]

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.

Definition at line 127 of file Geometry.

Eigen::Hyperplane::~Hyperplane ( ) [inline]

Definition at line 133 of file Geometry.

template<typename OtherScalarType , int OtherOptions>
Eigen::Hyperplane::Hyperplane ( const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &  other) [inline, explicit]

Copy constructor with scalar type conversion.

Definition at line 265 of file Geometry.


Member Function Documentation

Scalar Eigen::Hyperplane::absDistance ( const VectorType p) const [inline]
Returns:
the absolute distance between the plane *this and a point p.
See also:
signedDistance()

Definition at line 152 of file Geometry.

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

Definition at line 257 of file Geometry.

const Coefficients& Eigen::Hyperplane::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 $

Definition at line 180 of file Geometry.

Coefficients& Eigen::Hyperplane::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 $

Definition at line 185 of file Geometry.

Index Eigen::Hyperplane::dim ( ) const [inline]
Returns:
the dimension in which the plane holds

Definition at line 136 of file Geometry.

VectorType Eigen::Hyperplane::intersection ( const Hyperplane 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.

Definition at line 193 of file Geometry.

template<int OtherOptions>
bool Eigen::Hyperplane::isApprox ( const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &  other,
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()

Definition at line 273 of file Geometry.

ConstNormalReturnType Eigen::Hyperplane::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.

Definition at line 161 of file Geometry.

NormalReturnType Eigen::Hyperplane::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.

Definition at line 166 of file Geometry.

void Eigen::Hyperplane::normalize ( void  ) [inline]

normalizes *this

Definition at line 139 of file Geometry.

const Scalar& Eigen::Hyperplane::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.

Definition at line 171 of file Geometry.

Scalar& Eigen::Hyperplane::offset ( ) [inline]
Returns:
a non-constant reference to the distance to the origin, which is also the constant part of the implicit equation

Definition at line 175 of file Geometry.

VectorType Eigen::Hyperplane::projection ( const VectorType p) const [inline]
Returns:
the projection of a point p onto the plane *this.

Definition at line 156 of file Geometry.

Scalar Eigen::Hyperplane::signedDistance ( const VectorType p) const [inline]
Returns:
the signed distance between the plane *this and a point p.
See also:
absDistance()

Definition at line 147 of file Geometry.

static Hyperplane Eigen::Hyperplane::Through ( const VectorType p0,
const VectorType p1 
) [inline, static]

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.

Definition at line 102 of file Geometry.

static Hyperplane Eigen::Hyperplane::Through ( const VectorType p0,
const VectorType p1,
const VectorType p2 
) [inline, static]

Constructs a hyperplane passing through the three points.

The dimension of the ambient space is required to be exactly 3.

Definition at line 113 of file Geometry.

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

Definition at line 221 of file Geometry.

template<int TrOptions>
Hyperplane& Eigen::Hyperplane::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.

Definition at line 242 of file Geometry.


Member Data Documentation

Definition at line 278 of file Geometry.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011