11#ifndef EIGEN_HYPERPLANE_H
12#define EIGEN_HYPERPLANE_H
33template <
typename _Scalar,
int _AmbientDim,
int _Options>
42 typedef _Scalar Scalar;
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 EIGEN_DEVICE_FUNC
inline Index dim()
const {
return AmbientDimAtCompileTime==
Dynamic ? m_coeffs.size()-1 :
Index(AmbientDimAtCompileTime); }
167 EIGEN_DEVICE_FUNC
inline const Scalar&
offset()
const {
return m_coeffs.
coeff(
dim()); }
171 EIGEN_DEVICE_FUNC
inline Scalar&
offset() {
return m_coeffs(
dim()); }
191 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
VectorType, 2)
195 if(internal::isMuchSmallerThan(
det, Scalar(1)))
197 if(numext::abs(
coeffs().coeff(1))>numext::abs(
coeffs().coeff(0)))
216 template<
typename XprType>
228 eigen_assert(0 &&
"invalid traits value in Hyperplane::transform()");
240 template<
int TrOptions>
254 template<
typename NewScalarType>
263 template<
typename OtherScalarType,
int OtherOptions>
271 template<
int OtherOptions>
273 {
return m_coeffs.isApprox(other.m_coeffs,
prec); }
277 Coefficients m_coeffs;
EIGEN_DEVICE_FUNC TransposeReturnType transpose()
Definition Transpose.h:182
\geometry_module
Definition Hyperplane.h:35
EIGEN_DEVICE_FUNC 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
EIGEN_DEVICE_FUNC 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:241
EIGEN_DEVICE_FUNC internal::cast_return_type< Hyperplane, Hyperplane< NewScalarType, AmbientDimAtCompileTime, Options > >::type cast() const
Definition Hyperplane.h:256
EIGEN_DEVICE_FUNC Index dim() const
Definition Hyperplane.h:132
EIGEN_DEVICE_FUNC 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:217
EIGEN_DEVICE_FUNC 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
EIGEN_DEVICE_FUNC bool isApprox(const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
Definition Hyperplane.h:272
Eigen::Index Index
Definition Hyperplane.h:44
EIGEN_DEVICE_FUNC Scalar & offset()
Definition Hyperplane.h:171
EIGEN_DEVICE_FUNC Scalar signedDistance(const VectorType &p) const
Definition Hyperplane.h:143
EIGEN_DEVICE_FUNC Scalar absDistance(const VectorType &p) const
Definition Hyperplane.h:148
EIGEN_DEVICE_FUNC const Coefficients & coeffs() const
Definition Hyperplane.h:176
EIGEN_DEVICE_FUNC Hyperplane()
Default constructor without initialization.
Definition Hyperplane.h:53
EIGEN_DEVICE_FUNC VectorType intersection(const Hyperplane &other) const
Definition Hyperplane.h:189
EIGEN_DEVICE_FUNC Hyperplane(Index _dim)
Constructs a dynamic-size hyperplane with _dim the dimension of the ambient space.
Definition Hyperplane.h:62
EIGEN_DEVICE_FUNC const Scalar & offset() const
Definition Hyperplane.h:167
EIGEN_DEVICE_FUNC NormalReturnType normal()
Definition Hyperplane.h:162
EIGEN_DEVICE_FUNC Hyperplane(const ParametrizedLine< Scalar, AmbientDimAtCompileTime > ¶metrized)
Constructs a hyperplane passing through the parametrized line parametrized.
Definition Hyperplane.h:123
EIGEN_DEVICE_FUNC void normalize(void)
normalizes *this
Definition Hyperplane.h:135
EIGEN_DEVICE_FUNC Coefficients & coeffs()
Definition Hyperplane.h:181
EIGEN_DEVICE_FUNC ConstNormalReturnType normal() const
Definition Hyperplane.h:157
EIGEN_DEVICE_FUNC Hyperplane(const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &other)
Copy constructor with scalar type conversion.
Definition Hyperplane.h:264
static EIGEN_DEVICE_FUNC Hyperplane Through(const VectorType &p0, const VectorType &p1)
Constructs a hyperplane passing through the two points.
Definition Hyperplane.h:88
static EIGEN_DEVICE_FUNC Hyperplane Through(const VectorType &p0, const VectorType &p1, const VectorType &p2)
Constructs a hyperplane passing through the three points.
Definition Hyperplane.h:99
EIGEN_DEVICE_FUNC VectorType projection(const VectorType &p) const
Definition Hyperplane.h:152
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
EIGEN_DEVICE_FUNC ScalarBinaryOpTraits< typenameinternal::traits< Derived >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
EIGEN_DEVICE_FUNC RealScalar norm() const
Definition Dot.h:103
EIGEN_DEVICE_FUNC const Inverse< Derived > inverse() const
\lu_module
Definition InverseImpl.h:348
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & coeff(Index rowId, Index colId) const
This is an overloaded version of DenseCoeffsBase<Derived,ReadOnlyAccessors>::coeff(Index,...
Definition PlainObjectBase.h:152
EIGEN_DEVICE_FUNC PlainObject unitOrthogonal(void) const
\geometry_module
Definition OrthoMethods.h:227
TransformTraits
Enum used to specify how a particular transformation is stored in a matrix.
Definition Constants.h:455
@ ComputeFullV
Used in JacobiSVD to indicate that the square matrix V is to be computed.
Definition Constants.h:397
@ Affine
Transformation is an affine transformation stored as a (Dim+1)^2 matrix whose last row is assumed to ...
Definition Constants.h:460
@ Isometry
Transformation is an isometry.
Definition Constants.h:457
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition Constants.h:22
Holds information about the various numeric (i.e.
Definition NumTraits.h:236
Definition XprHelper.h:510