11#ifndef EIGEN_PARAMETRIZEDLINE_H
12#define EIGEN_PARAMETRIZEDLINE_H
15#include "./InternalHeaderCheck.h"
32template <
typename Scalar_,
int AmbientDim_,
int Options_>
35 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(Scalar_, AmbientDim_)
36 enum { AmbientDimAtCompileTime = AmbientDim_, Options = Options_ };
37 typedef Scalar_ Scalar;
38 typedef typename NumTraits<Scalar>::Real RealScalar;
45 template <
int OtherOptions>
47 : m_origin(other.origin()), m_direction(other.direction()) {}
57 : m_origin(origin), m_direction(direction) {}
59 template <
int OtherOptions>
70 EIGEN_DEVICE_FUNC
inline Index dim()
const {
return m_direction.size(); }
72 EIGEN_DEVICE_FUNC
const VectorType& origin()
const {
return m_origin; }
73 EIGEN_DEVICE_FUNC VectorType& origin() {
return m_origin; }
75 EIGEN_DEVICE_FUNC
const VectorType& direction()
const {
return m_direction; }
76 EIGEN_DEVICE_FUNC VectorType& direction() {
return m_direction; }
83 return (diff - direction().dot(diff) * direction()).squaredNorm();
94 return origin() + direction().dot(p - origin()) * direction();
97 EIGEN_DEVICE_FUNC VectorType
pointAt(
const Scalar& t)
const;
99 template <
int OtherOptions>
100 EIGEN_DEVICE_FUNC Scalar
103 template <
int OtherOptions>
106 template <
int OtherOptions>
107 EIGEN_DEVICE_FUNC VectorType
116 template <
typename XprType>
120 direction() = (mat * direction()).normalized();
122 direction() = mat * direction();
124 eigen_assert(0 &&
"invalid traits value in ParametrizedLine::transform()");
126 origin() = mat * origin();
137 template <
int TrOptions>
150 template <
typename NewScalarType>
151 EIGEN_DEVICE_FUNC
inline
155 return typename internal::cast_return_type<
160 template <
typename OtherScalarType,
int OtherOptions>
164 m_direction = other.direction().template
cast<Scalar>();
173 return m_origin.isApprox(other.m_origin, prec) && m_direction.isApprox(other.m_direction, prec);
177 VectorType m_origin, m_direction;
184template <
typename Scalar_,
int AmbientDim_,
int Options_>
185template <
int OtherOptions>
188 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
VectorType, 2)
189 direction() = hyperplane.
normal().unitOrthogonal();
195template <
typename Scalar_,
int AmbientDim_,
int Options_>
198 return origin() + (direction() * t);
203template <
typename Scalar_,
int AmbientDim_,
int Options_>
204template <
int OtherOptions>
207 return -(hyperplane.
offset() + hyperplane.
normal().dot(origin())) / hyperplane.
normal().dot(direction());
213template <
typename Scalar_,
int AmbientDim_,
int Options_>
214template <
int OtherOptions>
217 return intersectionParameter(hyperplane);
222template <
typename Scalar_,
int AmbientDim_,
int Options_>
223template <
int OtherOptions>
227 return pointAt(intersectionParameter(hyperplane));
A hyperplane.
Definition Hyperplane.h:37
ConstNormalReturnType normal() const
Definition Hyperplane.h:147
const Scalar & offset() const
Definition Hyperplane.h:159
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:52
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:186
A parametrized line.
Definition ParametrizedLine.h:33
ParametrizedLine & transform(const Transform< Scalar, AmbientDimAtCompileTime, Affine, TrOptions > &t, TransformTraits traits=Affine)
Definition ParametrizedLine.h:138
ParametrizedLine & transform(const MatrixBase< XprType > &mat, TransformTraits traits=Affine)
Definition ParametrizedLine.h:117
RealScalar squaredDistance(const VectorType &p) const
Definition ParametrizedLine.h:81
RealScalar distance(const VectorType &p) const
Definition ParametrizedLine.h:88
internal::cast_return_type< ParametrizedLine, ParametrizedLine< NewScalarType, AmbientDimAtCompileTime, Options > >::type cast() const
Definition ParametrizedLine.h:154
ParametrizedLine(const VectorType &origin, const VectorType &direction)
Definition ParametrizedLine.h:56
ParametrizedLine(Index _dim)
Definition ParametrizedLine.h:51
bool isApprox(const ParametrizedLine &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
Definition ParametrizedLine.h:171
VectorType pointAt(const Scalar &t) const
Definition ParametrizedLine.h:197
ParametrizedLine()
Definition ParametrizedLine.h:43
static ParametrizedLine Through(const VectorType &p0, const VectorType &p1)
Definition ParametrizedLine.h:63
Index dim() const
Definition ParametrizedLine.h:70
Eigen::Index Index
Definition ParametrizedLine.h:39
ParametrizedLine(const ParametrizedLine< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &other)
Definition ParametrizedLine.h:161
VectorType projection(const VectorType &p) const
Definition ParametrizedLine.h:93
TransformTraits
Definition Constants.h:453
@ Affine
Definition Constants.h:458
@ Isometry
Definition Constants.h:455
Namespace containing all symbols from the Eigen library.
Definition Core:137
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:83
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition Meta.h:523