11#ifndef EIGEN_HYPERPLANE_H
12#define EIGEN_HYPERPLANE_H
33template <
typename _Scalar,
int _AmbientDim,
int _Options>
37 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,
_AmbientDim==Dynamic ? Dynamic :
_AmbientDim+1)
42 typedef _Scalar Scalar;
43 typedef typename NumTraits<Scalar>::Real
RealScalar;
46 typedef Matrix<Scalar,
Index(AmbientDimAtCompileTime)==Dynamic
55 template<
int OtherOptions>
68 : m_coeffs(n.size()+1)
79 : m_coeffs(n.size()+1)
101 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
VectorType, 3)
132 inline Index dim()
const {
return AmbientDimAtCompileTime==Dynamic ? m_coeffs.size()-1 :
Index(AmbientDimAtCompileTime); }
137 m_coeffs /=
normal().norm();
167 inline const Scalar&
offset()
const {
return m_coeffs.coeff(
dim()); }
192 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
VectorType, 2)
196 if(internal::isMuchSmallerThan(
det, Scalar(1)))
217 template<
typename XprType>
226 eigen_assert(0 &&
"invalid traits value in Hyperplane::transform()");
238 template<
int TrOptions>
252 template<
typename NewScalarType>
261 template<
typename OtherScalarType,
int OtherOptions>
269 template<
int OtherOptions>
271 {
return m_coeffs.isApprox(other.m_coeffs,
prec); }
275 Coefficients m_coeffs;
\geometry_module
Definition Hyperplane.h:35
Scalar & offset()
Definition Hyperplane.h:171
Hyperplane(const VectorType &n, const VectorType &e)
Construct a plane from its normal n and a point e onto the plane.
Definition Hyperplane.h:67
Index dim() const
Definition Hyperplane.h:132
static Hyperplane Through(const VectorType &p0, const VectorType &p1, const VectorType &p2)
Constructs a hyperplane passing through the three points.
Definition Hyperplane.h:99
Scalar absDistance(const VectorType &p) const
Definition Hyperplane.h:148
VectorType intersection(const Hyperplane &other) const
Definition Hyperplane.h:189
Hyperplane & transform(const Transform< Scalar, AmbientDimAtCompileTime, Affine, TrOptions > &t, TransformTraits traits=Affine)
Applies the transformation t to *this and returns a reference to *this.
Definition Hyperplane.h:239
NormalReturnType normal()
Definition Hyperplane.h:162
Eigen::Index Index
Definition Hyperplane.h:44
const Coefficients & coeffs() const
Definition Hyperplane.h:176
Hyperplane(Index _dim)
Constructs a dynamic-size hyperplane with _dim the dimension of the ambient space.
Definition Hyperplane.h:62
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...
Definition Hyperplane.h:78
static Hyperplane Through(const VectorType &p0, const VectorType &p1)
Constructs a hyperplane passing through the two points.
Definition Hyperplane.h:88
VectorType projection(const VectorType &p) const
Definition Hyperplane.h:152
Hyperplane()
Default constructor without initialization.
Definition Hyperplane.h:53
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:218
Scalar signedDistance(const VectorType &p) const
Definition Hyperplane.h:143
ConstNormalReturnType normal() const
Definition Hyperplane.h:157
Coefficients & coeffs()
Definition Hyperplane.h:181
Hyperplane(const ParametrizedLine< Scalar, AmbientDimAtCompileTime > ¶metrized)
Constructs a hyperplane passing through the parametrized line parametrized.
Definition Hyperplane.h:123
internal::cast_return_type< Hyperplane, Hyperplane< NewScalarType, AmbientDimAtCompileTime, Options > >::type cast() const
Definition Hyperplane.h:254
bool isApprox(const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
Definition Hyperplane.h:270
Hyperplane(const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &other)
Copy constructor with scalar type conversion.
Definition Hyperplane.h:262
void normalize(void)
normalizes *this
Definition Hyperplane.h:135
const Scalar & offset() const
Definition Hyperplane.h:167
Pseudo expression representing a solving operation.
Definition Solve.h:63
TransformTraits
Enum used to specify how a particular transformation is stored in a matrix.
Definition Constants.h:445
@ ComputeFullV
Used in JacobiSVD to indicate that the square matrix V is to be computed.
Definition Constants.h:387
@ Affine
Transformation is an affine transformation stored as a (Dim+1)^2 matrix whose last row is assumed to ...
Definition Constants.h:450
@ Isometry
Transformation is an isometry.
Definition Constants.h:447
Holds information about the various numeric (i.e.
Definition NumTraits.h:108
Definition XprHelper.h:500