32 template <
typename _Scalar,
int _AmbientDim>
36 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim==
Dynamic ?
Dynamic : _AmbientDim+1)
37 enum { AmbientDimAtCompileTime = _AmbientDim };
38 typedef _Scalar Scalar;
51 inline explicit Hyperplane(
int _dim) : m_coeffs(_dim+1) {}
56 inline Hyperplane(
const VectorType& n,
const VectorType& e)
57 : m_coeffs(n.
size()+1)
60 offset() = -e.eigen2_dot(n);
68 : m_coeffs(n.
size()+1)
80 result.
normal() = (p1 - p0).unitOrthogonal();
81 result.offset() = -result.normal().eigen2_dot(p0);
88 static inline Hyperplane Through(
const VectorType& p0,
const VectorType& p1,
const VectorType& p2)
90 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(VectorType, 3)
92 result.
normal() = (p2 - p0).cross(p1 - p0).normalized();
93 result.offset() = -result.normal().eigen2_dot(p0);
104 normal() = parametrized.direction().unitOrthogonal();
111 inline int dim()
const {
return int(AmbientDimAtCompileTime)==
Dynamic ? m_coeffs.size()-1 : int(AmbientDimAtCompileTime); }
116 m_coeffs /=
normal().norm();
136 inline const NormalReturnType
normal()
const {
return NormalReturnType(*const_cast<Coefficients*>(&m_coeffs),0,0,
dim(),1); }
141 inline NormalReturnType
normal() {
return NormalReturnType(m_coeffs,0,0,
dim(),1); }
146 inline const Scalar&
offset()
const {
return m_coeffs.coeff(
dim()); }
170 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(VectorType, 2)
174 if(ei_isMuchSmallerThan(det, Scalar(1)))
183 Scalar invdet = Scalar(1) / det;
195 template<
typename XprType>
204 ei_assert(
"invalid traits value in Hyperplane::transform()");
229 template<
typename NewScalarType>
238 template<
typename OtherScalarType>
240 { m_coeffs = other.
coeffs().template cast<Scalar>(); }
247 {
return m_coeffs.isApprox(other.m_coeffs, prec); }
Definition: XprHelper.h:393
void normalize(void)
normalizes *this
Definition: Hyperplane.h:114
Hyperplane & transform(const Transform< Scalar, AmbientDimAtCompileTime > &t, TransformTraits traits=Affine)
Applies the transformation t to *this and returns a reference to *this.
Definition: Hyperplane.h:216
Hyperplane()
Default constructor without initialization.
Definition: Hyperplane.h:47
int dim() const
Definition: Hyperplane.h:111
internal::cast_return_type< Hyperplane, Hyperplane< NewScalarType, AmbientDimAtCompileTime > >::type cast() const
Definition: Hyperplane.h:231
NormalReturnType normal()
Definition: Hyperplane.h:141
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Transformation is an isometry.
Definition: Constants.h:391
Holds information about the various numeric (i.e.
Definition: NumTraits.h:88
Hyperplane(const Hyperplane< OtherScalarType, AmbientDimAtCompileTime > &other)
Copy constructor with scalar type conversion.
Definition: Hyperplane.h:239
Hyperplane & transform(const MatrixBase< XprType > &mat, TransformTraits traits=Affine)
Applies the transformation matrix mat to *this and returns a reference to *this.
Definition: Hyperplane.h:196
static Hyperplane Through(const VectorType &p0, const VectorType &p1, const VectorType &p2)
Constructs a hyperplane passing through the three points.
Definition: Hyperplane.h:88
Hyperplane(const ParametrizedLine< Scalar, AmbientDimAtCompileTime > ¶metrized)
Constructs a hyperplane passing through the parametrized line parametrized.
Definition: Hyperplane.h:102
detail::size< coerce_list< Ts... >> size
Get the size of a list (number of elements.)
Definition: Size.h:56
const Scalar & offset() const
Definition: Hyperplane.h:146
Definition: Hyperplane.h:33
TransformTraits
Enum used to specify how a particular transformation is stored in a matrix.
Definition: Constants.h:389
const internal::inverse_impl< Derived > inverse() const
Definition: Inverse.h:320
Scalar absDistance(const VectorType &p) const
Definition: Hyperplane.h:127
Scalar signedDistance(const VectorType &p) const
Definition: Hyperplane.h:122
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...
Definition: Hyperplane.h:67
static Hyperplane Through(const VectorType &p0, const VectorType &p1)
Constructs a hyperplane passing through the two points.
Definition: Hyperplane.h:77
VectorType intersection(const Hyperplane &other)
Definition: Hyperplane.h:168
const Coefficients & coeffs() const
Definition: Hyperplane.h:155
Hyperplane(int _dim)
Constructs a dynamic-size hyperplane with _dim the dimension of the ambient space.
Definition: Hyperplane.h:51
Coefficients & coeffs()
Definition: Hyperplane.h:160
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
VectorType projection(const VectorType &p) const
Definition: Hyperplane.h:131
bool isApprox(const Hyperplane &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
Definition: Hyperplane.h:246
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
Scalar & offset()
Definition: Hyperplane.h:150
Transformation is an affine transformation stored as a (Dim+1)^2 matrix whose last row is assumed to ...
Definition: Constants.h:394
Hyperplane(const VectorType &n, const VectorType &e)
Construct a plane from its normal n and a point e onto the plane.
Definition: Hyperplane.h:56
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Definition: ParametrizedLine.h:29
const NormalReturnType normal() const
Definition: Hyperplane.h:136