28 template <
typename _Scalar,
int _AmbientDim>
32 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
33 enum { AmbientDimAtCompileTime = _AmbientDim };
34 typedef _Scalar Scalar;
49 : m_origin(origin), m_direction(direction) {}
60 inline int dim()
const {
return m_direction.size(); }
62 const VectorType& origin()
const {
return m_origin; }
63 VectorType& origin() {
return m_origin; }
65 const VectorType& direction()
const {
return m_direction; }
66 VectorType& direction() {
return m_direction; }
73 VectorType diff = p-origin();
74 return (diff - diff.eigen2_dot(direction())* direction()).squaredNorm();
83 {
return origin() + (p-origin()).eigen2_dot(direction()) * direction(); }
92 template<
typename NewScalarType>
101 template<
typename OtherScalarType>
104 m_origin = other.origin().template cast<Scalar>();
105 m_direction = other.direction().template cast<Scalar>();
113 {
return m_origin.isApprox(other.m_origin, prec) && m_direction.isApprox(other.m_direction, prec); }
117 VectorType m_origin, m_direction;
124 template <
typename _Scalar,
int _AmbientDim>
127 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(VectorType, 2)
128 direction() = hyperplane.
normal().unitOrthogonal();
134 template <
typename _Scalar,
int _AmbientDim>
137 return -(hyperplane.
offset()+origin().eigen2_dot(hyperplane.
normal()))
138 /(direction().eigen2_dot(hyperplane.
normal()));
internal::cast_return_type< ParametrizedLine, ParametrizedLine< NewScalarType, AmbientDimAtCompileTime > >::type cast() const
Definition: ParametrizedLine.h:94
Definition: XprHelper.h:393
static ParametrizedLine Through(const VectorType &p0, const VectorType &p1)
Constructs a parametrized line going from p0 to p1.
Definition: ParametrizedLine.h:54
ParametrizedLine(int _dim)
Constructs a dynamic-size line with _dim the dimension of the ambient space.
Definition: ParametrizedLine.h:43
RealScalar distance(const VectorType &p) const
Definition: ParametrizedLine.h:79
iterative scaling algorithm to equilibrate rows and column norms in matrices
Definition: TestIMU_Common.h:87
Holds information about the various numeric (i.e.
Definition: NumTraits.h:88
ParametrizedLine(const VectorType &origin, const VectorType &direction)
Initializes a parametrized line of direction direction and origin origin.
Definition: ParametrizedLine.h:48
const Scalar & offset() const
Definition: Hyperplane.h:146
Definition: Hyperplane.h:33
int dim() const
Definition: ParametrizedLine.h:60
bool isApprox(const ParametrizedLine &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
Definition: ParametrizedLine.h:112
ParametrizedLine()
Default constructor without initialization.
Definition: ParametrizedLine.h:39
ParametrizedLine(const ParametrizedLine< OtherScalarType, AmbientDimAtCompileTime > &other)
Copy constructor with scalar type conversion.
Definition: ParametrizedLine.h:102
RealScalar squaredDistance(const VectorType &p) const
Definition: ParametrizedLine.h:71
VectorType projection(const VectorType &p) const
Definition: ParametrizedLine.h:82
Scalar intersection(const Hyperplane< _Scalar, _AmbientDim > &hyperplane)
Definition: ParametrizedLine.h:135
Definition: ParametrizedLine.h:29
const NormalReturnType normal() const
Definition: Hyperplane.h:136