A hyperplane. More...
#include <Hyperplane.h>
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.
_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.
typedef Matrix<Scalar,Index(AmbientDimAtCompileTime)==Dynamic ? Dynamic : Index(AmbientDimAtCompileTime)+1,1,Options> Coefficients |
typedef const Block<const Coefficients,AmbientDimAtCompileTime,1> ConstNormalReturnType |
typedef DenseIndex Index |
typedef Block<Coefficients,AmbientDimAtCompileTime,1> NormalReturnType |
typedef NumTraits<Scalar>::Real RealScalar |
typedef _Scalar Scalar |
typedef Matrix<Scalar,AmbientDimAtCompileTime,1> VectorType |
Hyperplane | ( | ) | [inline, explicit] |
Default constructor without initialization
Referenced by Hyperplane< _Scalar, _AmbientDim, _Options >::cast().
Hyperplane | ( | const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > & | other | ) | [inline] |
Hyperplane | ( | Index | _dim | ) | [inline, explicit] |
Constructs a dynamic-size hyperplane with _dim the dimension of the ambient space
Hyperplane | ( | const VectorType & | n, |
const VectorType & | e | ||
) | [inline] |
Construct a plane from its normal n and a point e onto the plane.
References Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Hyperplane< _Scalar, _AmbientDim, _Options >::offset().
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 .
References Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Hyperplane< _Scalar, _AmbientDim, _Options >::offset().
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.
References ParametrizedLine< _Scalar, _AmbientDim, _Options >::direction(), Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), Hyperplane< _Scalar, _AmbientDim, _Options >::offset(), and ParametrizedLine< _Scalar, _AmbientDim, _Options >::origin().
~Hyperplane | ( | ) | [inline] |
Hyperplane | ( | const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
References Hyperplane< _Scalar, _AmbientDim, _Options >::coeffs(), and Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.
Scalar absDistance | ( | const VectorType & | p | ) | const [inline] |
*this
and a point p. References abs(), and Hyperplane< _Scalar, _AmbientDim, _Options >::signedDistance().
internal::cast_return_type<Hyperplane, Hyperplane<NewScalarType,AmbientDimAtCompileTime,Options> >::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
.
References Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane().
const Coefficients& coeffs | ( | ) | const [inline] |
References Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.
Referenced by Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane(), and Hyperplane< _Scalar, _AmbientDim, _Options >::intersection().
Coefficients& coeffs | ( | ) | [inline] |
References Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.
References Hyperplane< _Scalar, _AmbientDim, _Options >::AmbientDimAtCompileTime, Eigen::Dynamic, and Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.
Referenced by Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Hyperplane< _Scalar, _AmbientDim, _Options >::offset().
VectorType intersection | ( | const Hyperplane< _Scalar, _AmbientDim, _Options > & | other | ) | const [inline] |
*this
and other are lines.References abs(), PlainObjectBase< Derived >::coeff(), Hyperplane< _Scalar, _AmbientDim, _Options >::coeffs(), EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Eigen::internal::isMuchSmallerThan().
bool isApprox | ( | const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > & | 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.References Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.
ConstNormalReturnType normal | ( | ) | const [inline] |
References Hyperplane< _Scalar, _AmbientDim, _Options >::dim(), and Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.
Referenced by Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane(), ParametrizedLine< _Scalar, _AmbientDim, _Options >::intersectionParameter(), Hyperplane< _Scalar, _AmbientDim, _Options >::normalize(), ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine(), Hyperplane< _Scalar, _AmbientDim, _Options >::projection(), Hyperplane< _Scalar, _AmbientDim, _Options >::signedDistance(), Hyperplane< _Scalar, _AmbientDim, _Options >::Through(), and Hyperplane< _Scalar, _AmbientDim, _Options >::transform().
NormalReturnType normal | ( | ) | [inline] |
References Hyperplane< _Scalar, _AmbientDim, _Options >::dim(), and Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.
void normalize | ( | void | ) | [inline] |
normalizes *this
References Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs, and Hyperplane< _Scalar, _AmbientDim, _Options >::normal().
References PlainObjectBase< Derived >::coeff(), Hyperplane< _Scalar, _AmbientDim, _Options >::dim(), and Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.
Referenced by Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane(), ParametrizedLine< _Scalar, _AmbientDim, _Options >::intersectionParameter(), ParametrizedLine< _Scalar, _AmbientDim, _Options >::ParametrizedLine(), Hyperplane< _Scalar, _AmbientDim, _Options >::signedDistance(), and Hyperplane< _Scalar, _AmbientDim, _Options >::transform().
References Hyperplane< _Scalar, _AmbientDim, _Options >::dim(), and Hyperplane< _Scalar, _AmbientDim, _Options >::m_coeffs.
VectorType projection | ( | const VectorType & | p | ) | const [inline] |
*this
. References Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Hyperplane< _Scalar, _AmbientDim, _Options >::signedDistance().
Scalar signedDistance | ( | const VectorType & | p | ) | const [inline] |
*this
and a point p. References Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), and Hyperplane< _Scalar, _AmbientDim, _Options >::offset().
Referenced by Hyperplane< _Scalar, _AmbientDim, _Options >::absDistance(), and Hyperplane< _Scalar, _AmbientDim, _Options >::projection().
static 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.
References Hyperplane< _Scalar, _AmbientDim, _Options >::normal().
static 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.
References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Hyperplane< _Scalar, _AmbientDim, _Options >::normal().
Hyperplane& 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. |
References Eigen::Affine, MatrixBase< Derived >::inverse(), Eigen::Isometry, and Hyperplane< _Scalar, _AmbientDim, _Options >::normal().
Referenced by Hyperplane< _Scalar, _AmbientDim, _Options >::transform().
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
.
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. |
References Transform< _Scalar, _Dim, _Mode, _Options >::linear(), Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), Hyperplane< _Scalar, _AmbientDim, _Options >::offset(), Hyperplane< _Scalar, _AmbientDim, _Options >::transform(), and Transform< _Scalar, _Dim, _Mode, _Options >::translation().
Coefficients m_coeffs [protected] |
Referenced by Hyperplane< _Scalar, _AmbientDim, _Options >::coeffs(), Hyperplane< _Scalar, _AmbientDim, _Options >::dim(), Hyperplane< _Scalar, _AmbientDim, _Options >::Hyperplane(), Hyperplane< _Scalar, _AmbientDim, _Options >::isApprox(), Hyperplane< _Scalar, _AmbientDim, _Options >::normal(), Hyperplane< _Scalar, _AmbientDim, _Options >::normalize(), and Hyperplane< _Scalar, _AmbientDim, _Options >::offset().