20 template<
int d,
class T>
27 : m_start(point1), m_end(point2) { }
75 T d1 = dir[0] * p[1] - dir[1] * p[0];
77 T d2 = dir[0] * p[1] - dir[1] * p[0];
78 size_t i1 = d1 > 0 ? 2 : (d1 < 0 ? 1 : 0);
79 size_t i2 = d2 > 0 ? 2 : (d2 < 0 ? 1 : 0);
83 inline const gsVector<T, d> direction()
const {
return m_end - m_start; }
85 T length()
const {
return (m_end - m_start).norm(); }
87 # define Eigen gsEigen
88 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
93 gsPoint<d, T> m_start;
bool intersectSegment(const gsPoint< d, T > &origin, const gsPoint< d, T > &end)
Tells wheter line intersects segment.
Definition: gsLineSegment.h:40
A Point in T^d, with an index number.
Definition: gsPoint.h:26
Represents a line segment in d dimensions.
Definition: gsLineSegment.h:21
gsLineSegment(const gsPoint< d, T > &point1, const gsPoint< d, T > &point2)
Constructs a line segment starting at point1 and ending at point2.
Definition: gsLineSegment.h:26