11 #ifndef EIGEN_HYPERPLANE_H 12 #define EIGEN_HYPERPLANE_H 33 template <
typename _Scalar,
int _AmbientDim,
int _Options>
55 template<
int OtherOptions>
67 inline Hyperplane(
const VectorType& n,
const VectorType& e)
91 result.
normal() = (p1 - p0).unitOrthogonal();
92 result.offset() = -p0.dot(result.normal());
99 static inline Hyperplane Through(
const VectorType& p0,
const VectorType& p1,
const VectorType& p2)
103 result.
normal() = (p2 - p0).cross(p1 - p0).normalized();
104 result.offset() = -p0.dot(result.normal());
195 Scalar invdet =
Scalar(1) / det;
207 template<
typename XprType>
216 eigen_assert(0 &&
"invalid traits value in Hyperplane::transform()");
228 template<
int TrOptions>
242 template<
typename NewScalarType>
251 template<
typename OtherScalarType,
int OtherOptions>
253 {
m_coeffs = other.coeffs().template cast<Scalar>(); }
259 template<
int OtherOptions>
261 {
return m_coeffs.isApprox(other.m_coeffs, prec); }
270 #endif // EIGEN_HYPERPLANE_H
const VectorType & origin() const
const NormalReturnType normal() const
Scalar signedDistance(const VectorType &p) const
Hyperplane(const Hyperplane< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &other)
const Block< const Coefficients, AmbientDimAtCompileTime, 1 > ConstNormalReturnType
NormalReturnType normal()
iterative scaling algorithm to equilibrate rows and column norms in matrices
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Block< Coefficients, AmbientDimAtCompileTime, 1 > NormalReturnType
bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, typename NumTraits< Scalar >::Real precision=NumTraits< Scalar >::dummy_precision())
Hyperplane(const VectorType &n, const Scalar &d)
Hyperplane & transform(const MatrixBase< XprType > &mat, TransformTraits traits=Affine)
static Hyperplane Through(const VectorType &p0, const VectorType &p1, const VectorType &p2)
Hyperplane(const ParametrizedLine< Scalar, AmbientDimAtCompileTime > ¶metrized)
VectorType intersection(const Hyperplane &other) const
const Coefficients & coeffs() const
Hyperplane(const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &other)
EIGEN_STRONG_INLINE const CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > abs() const
NumTraits< Scalar >::Real RealScalar
EIGEN_STRONG_INLINE const Scalar & coeff(Index rowId, Index colId) const
ConstNormalReturnType normal() const
Provides a generic way to set and pass user-specified options.
const VectorType & direction() const
static Hyperplane Through(const VectorType &p0, const VectorType &p1)
VectorType projection(const VectorType &p) const
bool isApprox(const Hyperplane< Scalar, AmbientDimAtCompileTime, OtherOptions > &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
const Scalar & offset() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Matrix< Scalar, AmbientDimAtCompileTime, 1 > VectorType
Expression of a fixed-size or dynamic-size block.
internal::cast_return_type< Hyperplane, Hyperplane< NewScalarType, AmbientDimAtCompileTime, Options > >::type cast() const
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar, Size)
const internal::inverse_impl< Derived > inverse() const
Hyperplane(const VectorType &n, const VectorType &e)
Matrix< Scalar, Index(AmbientDimAtCompileTime)==Dynamic?Dynamic:Index(AmbientDimAtCompileTime)+1, 1, Options > Coefficients
Base class for all dense matrices, vectors, and expressions.
Hyperplane & transform(const Transform< Scalar, AmbientDimAtCompileTime, Affine, TrOptions > &t, TransformTraits traits=Affine)
#define EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(TYPE, SIZE)
Scalar absDistance(const VectorType &p) const