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

A hyperplane.

Template parameters
_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.
_Options

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.

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

enum (anonymous) { AmbientDimAtCompileTime = _AmbientDim, Options = _Options }
using Coefficients = Matrix<Scalar, Index(AmbientDimAtCompileTime)==Dynamic ? Dynamic :Index(AmbientDimAtCompileTime)+1, 1, Options>
using ConstNormalReturnType = const Block<const Coefficients, AmbientDimAtCompileTime, 1>
using Index = Eigen::Index deprecated
using NormalReturnType = Block<Coefficients, AmbientDimAtCompileTime, 1>
using RealScalar = NumTraits<Scalar>::Real
using Scalar = _Scalar
using VectorType = Matrix<Scalar, AmbientDimAtCompileTime, 1>

Public static functions

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

Constructors, destructors, conversion operators

Hyperplane()
template<int OtherOptions>
Hyperplane(const Hyperplane<Scalar, AmbientDimAtCompileTime, OtherOptions>& other)
Hyperplane(Index _dim) explicit
Hyperplane(const VectorType& n, const VectorType& e)
Hyperplane(const VectorType& n, const Scalar& d)
Hyperplane(const ParametrizedLine<Scalar, AmbientDimAtCompileTime>& parametrized) explicit
template<typename OtherScalarType, int OtherOptions>
Hyperplane(const Hyperplane<OtherScalarType, AmbientDimAtCompileTime, OtherOptions>& other) explicit
~Hyperplane()

Public functions

auto absDistance(const VectorType& p) const -> Scalar
template<typename NewScalarType>
auto cast() const -> internal::cast_return_type<Hyperplane, Hyperplane<NewScalarType, AmbientDimAtCompileTime, Options>>::type
auto coeffs() const -> const Coefficients&
auto coeffs() -> Coefficients&
auto dim() const -> Index
auto intersection(const Hyperplane& other) const -> VectorType
template<int OtherOptions>
auto isApprox(const Hyperplane<Scalar, AmbientDimAtCompileTime, OtherOptions>& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::dummy_precision()) const -> bool
auto normal() const -> ConstNormalReturnType
auto normal() -> NormalReturnType
void normalize(void)
auto offset() const -> const Scalar&
auto offset() -> Scalar&
auto projection(const VectorType& p) const -> VectorType
auto signedDistance(const VectorType& p) const -> Scalar
template<typename XprType>
auto transform(const MatrixBase<XprType>& mat, TransformTraits traits = Affine) -> Hyperplane&
template<int TrOptions>
auto transform(const Transform<Scalar, AmbientDimAtCompileTime, Affine, TrOptions>& t, TransformTraits traits = Affine) -> Hyperplane&

Protected variables

Coefficients m_coeffs

Enum documentation

template<typename _Scalar, int _AmbientDim, int _Options>
enum Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::(anonymous)

Enumerators
AmbientDimAtCompileTime
Options

Typedef documentation

template<typename _Scalar, int _AmbientDim, int _Options>
typedef Matrix<Scalar, Index(AmbientDimAtCompileTime)==Dynamic ? Dynamic :Index(AmbientDimAtCompileTime)+1, 1, Options> Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Coefficients

template<typename _Scalar, int _AmbientDim, int _Options>
typedef const Block<const Coefficients, AmbientDimAtCompileTime, 1> Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::ConstNormalReturnType

template<typename _Scalar, int _AmbientDim, int _Options>
typedef Eigen::Index Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Index

template<typename _Scalar, int _AmbientDim, int _Options>
typedef Block<Coefficients, AmbientDimAtCompileTime, 1> Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::NormalReturnType

template<typename _Scalar, int _AmbientDim, int _Options>
typedef NumTraits<Scalar>::Real Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::RealScalar

template<typename _Scalar, int _AmbientDim, int _Options>
typedef _Scalar Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Scalar

template<typename _Scalar, int _AmbientDim, int _Options>
typedef Matrix<Scalar, AmbientDimAtCompileTime, 1> Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::VectorType

Function documentation

template<typename _Scalar, int _AmbientDim, int _Options>
static Hyperplane Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Through(const VectorType& p0, const VectorType& p1)

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>
static Hyperplane Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Through(const VectorType& p0, const VectorType& p1, const VectorType& p2)

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>
Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Hyperplane()

Default constructor without initialization

template<typename _Scalar, int _AmbientDim, int _Options> template<int OtherOptions>
Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Hyperplane(const Hyperplane<Scalar, AmbientDimAtCompileTime, OtherOptions>& other)

template<typename _Scalar, int _AmbientDim, int _Options>
Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Hyperplane(Index _dim) explicit

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

template<typename _Scalar, int _AmbientDim, int _Options>
Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Hyperplane(const VectorType& n, const VectorType& e)

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

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

template<typename _Scalar, int _AmbientDim, int _Options>
Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Hyperplane(const ParametrizedLine<Scalar, AmbientDimAtCompileTime>& parametrized) 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.

template<typename _Scalar, int _AmbientDim, int _Options> template<typename OtherScalarType, int OtherOptions>
Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::Hyperplane(const Hyperplane<OtherScalarType, AmbientDimAtCompileTime, OtherOptions>& other) explicit

Copy constructor with scalar type conversion

template<typename _Scalar, int _AmbientDim, int _Options>
Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::~Hyperplane()

template<typename _Scalar, int _AmbientDim, int _Options>
Scalar Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::absDistance(const VectorType& p) const

Returns the absolute distance between the plane *this and a point p.

template<typename _Scalar, int _AmbientDim, int _Options> template<typename NewScalarType>
internal::cast_return_type<Hyperplane, Hyperplane<NewScalarType, AmbientDimAtCompileTime, Options>>::type Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::cast() const

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>
const Coefficients& Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::coeffs() const

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>
Coefficients& Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::coeffs()

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>
Index Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::dim() const

Returns the dimension in which the plane holds

template<typename _Scalar, int _AmbientDim, int _Options>
VectorType Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::intersection(const Hyperplane& other) const

Returns the intersection of *this with other.

template<typename _Scalar, int _AmbientDim, int _Options> 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

Returns true if *this is approximately equal to other, within the precision determined by prec.

template<typename _Scalar, int _AmbientDim, int _Options>
ConstNormalReturnType Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::normal() const

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>
NormalReturnType Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::normal()

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>
void Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::normalize(void)

normalizes *this

template<typename _Scalar, int _AmbientDim, int _Options>
const Scalar& Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::offset() const

Returns the distance to the origin, which is also the "constant term" of the implicit equation

template<typename _Scalar, int _AmbientDim, int _Options>
Scalar& Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::offset()

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>
VectorType Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::projection(const VectorType& p) const

Returns the projection of a point p onto the plane *this.

template<typename _Scalar, int _AmbientDim, int _Options>
Scalar Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::signedDistance(const VectorType& p) const

Returns the signed distance between the plane *this and a point p.

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

Parameters
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.

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

template<typename _Scalar, int _AmbientDim, int _Options> template<int TrOptions>
Hyperplane& Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::transform(const Transform<Scalar, AmbientDimAtCompileTime, Affine, TrOptions>& t, TransformTraits traits = Affine)

Parameters
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.

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

Variable documentation

template<typename _Scalar, int _AmbientDim, int _Options>
Coefficients Eigen::Hyperplane<_Scalar, _AmbientDim, _Options>::m_coeffs protected