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.
_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. Notice that the dimension of the hyperplane is _AmbientDim-1. |
This class represents an hyperplane as the zero set of the implicit equation where
is a unit normal vector of the plane (linear part) and
is the distance (offset) to the origin.
Definition at line 47 of file Hyperplane.h.
#include <src/Geometry/Hyperplane.h>
Public Types | |
enum | { AmbientDimAtCompileTime = _AmbientDim } |
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 > | Coefficients |
typedef Block< Coefficients, AmbientDimAtCompileTime, 1 > | NormalReturnType |
typedef const Block< const Coefficients, AmbientDimAtCompileTime, 1 > | ConstNormalReturnType |
Public Member Functions | |
Hyperplane () | |
Default constructor without initialization. | |
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 ![]() | |
Hyperplane (const ParametrizedLine< Scalar, AmbientDimAtCompileTime > ¶metrized) | |
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 Scalar & | offset () const |
Scalar & | offset () |
const Coefficients & | coeffs () const |
Coefficients & | coeffs () |
VectorType | intersection (const Hyperplane &other) |
template<typename XprType > | |
Hyperplane & | transform (const MatrixBase< XprType > &mat, TransformTraits traits=Affine) |
Applies the transformation matrix mat to *this and returns a reference to *this . | |
Hyperplane & | transform (const Transform< Scalar, AmbientDimAtCompileTime, Affine > &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 > >::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=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 |
typedef Matrix<Scalar,Index(AmbientDimAtCompileTime)==Dynamic ? Dynamic : Index(AmbientDimAtCompileTime)+1,1> Hyperplane< _Scalar, _AmbientDim >::Coefficients |
Definition at line 58 of file Hyperplane.h.
typedef const Block<const Coefficients,AmbientDimAtCompileTime,1> Hyperplane< _Scalar, _AmbientDim >::ConstNormalReturnType |
Definition at line 60 of file Hyperplane.h.
typedef DenseIndex Hyperplane< _Scalar, _AmbientDim >::Index |
Definition at line 54 of file Hyperplane.h.
typedef Block<Coefficients,AmbientDimAtCompileTime,1> Hyperplane< _Scalar, _AmbientDim >::NormalReturnType |
Definition at line 59 of file Hyperplane.h.
typedef NumTraits<Scalar>::Real Hyperplane< _Scalar, _AmbientDim >::RealScalar |
Definition at line 53 of file Hyperplane.h.
typedef _Scalar Hyperplane< _Scalar, _AmbientDim >::Scalar |
Definition at line 52 of file Hyperplane.h.
typedef Matrix<Scalar,AmbientDimAtCompileTime,1> Hyperplane< _Scalar, _AmbientDim >::VectorType |
Definition at line 55 of file Hyperplane.h.
anonymous enum |
Definition at line 51 of file Hyperplane.h.
Hyperplane< _Scalar, _AmbientDim >::Hyperplane | ( | ) | [inline, explicit] |
Default constructor without initialization.
Definition at line 63 of file Hyperplane.h.
Referenced by Hyperplane< _Scalar, _AmbientDim >::cast().
Hyperplane< _Scalar, _AmbientDim >::Hyperplane | ( | Index | _dim ) | [inline, explicit] |
Constructs a dynamic-size hyperplane with _dim the dimension of the ambient space.
Definition at line 67 of file Hyperplane.h.
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.
Definition at line 72 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::normal(), and Hyperplane< _Scalar, _AmbientDim >::offset().
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 .
Definition at line 83 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::normal(), and Hyperplane< _Scalar, _AmbientDim >::offset().
Hyperplane< _Scalar, _AmbientDim >::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 118 of file Hyperplane.h.
References ParametrizedLine< _Scalar, _AmbientDim >::direction(), Hyperplane< _Scalar, _AmbientDim >::normal(), Hyperplane< _Scalar, _AmbientDim >::offset(), and ParametrizedLine< _Scalar, _AmbientDim >::origin().
Hyperplane< _Scalar, _AmbientDim >::~Hyperplane | ( | ) | [inline] |
Definition at line 124 of file Hyperplane.h.
Hyperplane< _Scalar, _AmbientDim >::Hyperplane | ( | const Hyperplane< OtherScalarType, AmbientDimAtCompileTime > & | other ) | [inline, explicit] |
Copy constructor with scalar type conversion.
Definition at line 255 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::coeffs(), and Hyperplane< _Scalar, _AmbientDim >::m_coeffs.
Scalar Hyperplane< _Scalar, _AmbientDim >::absDistance | ( | const VectorType & | p ) | const [inline] |
*this
and a point p. Definition at line 143 of file Hyperplane.h.
References abs(), and Hyperplane< _Scalar, _AmbientDim >::signedDistance().
internal::cast_return_type<Hyperplane, Hyperplane<NewScalarType,AmbientDimAtCompileTime> >::type Hyperplane< _Scalar, _AmbientDim >::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
.
Definition at line 247 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::Hyperplane().
const Coefficients& Hyperplane< _Scalar, _AmbientDim >::coeffs | ( | ) | const [inline] |
Definition at line 171 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::m_coeffs.
Referenced by Hyperplane< _Scalar, _AmbientDim >::Hyperplane(), and Hyperplane< _Scalar, _AmbientDim >::intersection().
Coefficients& Hyperplane< _Scalar, _AmbientDim >::coeffs | ( | ) | [inline] |
Definition at line 176 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::m_coeffs.
Index Hyperplane< _Scalar, _AmbientDim >::dim | ( | ) | const [inline] |
Definition at line 127 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::AmbientDimAtCompileTime, Dynamic, and Hyperplane< _Scalar, _AmbientDim >::m_coeffs.
Referenced by Hyperplane< _Scalar, _AmbientDim >::normal(), and Hyperplane< _Scalar, _AmbientDim >::offset().
VectorType Hyperplane< _Scalar, _AmbientDim >::intersection | ( | const Hyperplane< _Scalar, _AmbientDim > & | other ) | [inline] |
*this
and other are lines.Definition at line 184 of file Hyperplane.h.
References abs(), PlainObjectBase< Derived >::coeff(), Hyperplane< _Scalar, _AmbientDim >::coeffs(), det(), EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and internal::isMuchSmallerThan().
bool Hyperplane< _Scalar, _AmbientDim >::isApprox | ( | const Hyperplane< _Scalar, _AmbientDim > & | other, |
typename NumTraits< Scalar >::Real | prec = NumTraits<Scalar>::dummy_precision() |
||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.Definition at line 262 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::m_coeffs.
NormalReturnType Hyperplane< _Scalar, _AmbientDim >::normal | ( | ) | [inline] |
Definition at line 157 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::dim(), and Hyperplane< _Scalar, _AmbientDim >::m_coeffs.
ConstNormalReturnType Hyperplane< _Scalar, _AmbientDim >::normal | ( | ) | const [inline] |
Definition at line 152 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::dim(), and Hyperplane< _Scalar, _AmbientDim >::m_coeffs.
Referenced by Hyperplane< _Scalar, _AmbientDim >::Hyperplane(), ParametrizedLine< _Scalar, _AmbientDim >::intersection(), Hyperplane< _Scalar, _AmbientDim >::normalize(), ParametrizedLine< _Scalar, _AmbientDim >::ParametrizedLine(), Hyperplane< _Scalar, _AmbientDim >::projection(), Hyperplane< _Scalar, _AmbientDim >::signedDistance(), Hyperplane< _Scalar, _AmbientDim >::Through(), and Hyperplane< _Scalar, _AmbientDim >::transform().
void Hyperplane< _Scalar, _AmbientDim >::normalize | ( | void | ) | [inline] |
normalizes *this
Definition at line 130 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::m_coeffs, and Hyperplane< _Scalar, _AmbientDim >::normal().
Scalar& Hyperplane< _Scalar, _AmbientDim >::offset | ( | ) | [inline] |
Definition at line 166 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::dim(), and Hyperplane< _Scalar, _AmbientDim >::m_coeffs.
const Scalar& Hyperplane< _Scalar, _AmbientDim >::offset | ( | ) | const [inline] |
Definition at line 162 of file Hyperplane.h.
References PlainObjectBase< Derived >::coeff(), Hyperplane< _Scalar, _AmbientDim >::dim(), and Hyperplane< _Scalar, _AmbientDim >::m_coeffs.
Referenced by Hyperplane< _Scalar, _AmbientDim >::Hyperplane(), ParametrizedLine< _Scalar, _AmbientDim >::intersection(), ParametrizedLine< _Scalar, _AmbientDim >::ParametrizedLine(), Hyperplane< _Scalar, _AmbientDim >::signedDistance(), and Hyperplane< _Scalar, _AmbientDim >::transform().
VectorType Hyperplane< _Scalar, _AmbientDim >::projection | ( | const VectorType & | p ) | const [inline] |
*this
. Definition at line 147 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::normal(), and Hyperplane< _Scalar, _AmbientDim >::signedDistance().
Scalar Hyperplane< _Scalar, _AmbientDim >::signedDistance | ( | const VectorType & | p ) | const [inline] |
*this
and a point p. Definition at line 138 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::normal(), and Hyperplane< _Scalar, _AmbientDim >::offset().
Referenced by Hyperplane< _Scalar, _AmbientDim >::absDistance(), and Hyperplane< _Scalar, _AmbientDim >::projection().
static Hyperplane Hyperplane< _Scalar, _AmbientDim >::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 104 of file Hyperplane.h.
References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Hyperplane< _Scalar, _AmbientDim >::normal().
static Hyperplane Hyperplane< _Scalar, _AmbientDim >::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 93 of file Hyperplane.h.
References Hyperplane< _Scalar, _AmbientDim >::normal().
Hyperplane& Hyperplane< _Scalar, _AmbientDim >::transform | ( | const Transform< Scalar, AmbientDimAtCompileTime, Affine > & | t, |
TransformTraits | traits = Affine |
||
) | [inline] |
Applies the transformation t to *this
and returns a reference to *this
.
t | the transformation of dimension Dim |
traits | specifies 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 232 of file Hyperplane.h.
References Transform< _Scalar, _Dim, _Mode >::linear(), Hyperplane< _Scalar, _AmbientDim >::normal(), Hyperplane< _Scalar, _AmbientDim >::offset(), Hyperplane< _Scalar, _AmbientDim >::transform(), and Transform< _Scalar, _Dim, _Mode >::translation().
Hyperplane& 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
.
mat | the Dim x Dim transformation matrix |
traits | specifies whether the matrix mat represents an Isometry or a more generic Affine transformation. The default is Affine. |
Definition at line 212 of file Hyperplane.h.
References Affine, eigen_assert, MatrixBase< Derived >::inverse(), Isometry, and Hyperplane< _Scalar, _AmbientDim >::normal().
Referenced by Hyperplane< _Scalar, _AmbientDim >::transform().
Coefficients Hyperplane< _Scalar, _AmbientDim >::m_coeffs [protected] |
Definition at line 267 of file Hyperplane.h.
Referenced by Hyperplane< _Scalar, _AmbientDim >::coeffs(), Hyperplane< _Scalar, _AmbientDim >::dim(), Hyperplane< _Scalar, _AmbientDim >::Hyperplane(), Hyperplane< _Scalar, _AmbientDim >::isApprox(), Hyperplane< _Scalar, _AmbientDim >::normal(), Hyperplane< _Scalar, _AmbientDim >::normalize(), and Hyperplane< _Scalar, _AmbientDim >::offset().
Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:46:17 UTC 2011 |