Line2.hh
Go to the documentation of this file.
void Set(double _x1, double _y1, double _x2, double _y2)
Set the start and end point of the line segment.
Definition: Line2.hh:70
bool Within(const math::Vector2< T > &_pt, double _epsilon=1e-6) const
Check if the given point is between the start and end points of the line segment. This does not imply...
Definition: Line2.hh:162
bool operator==(const Line2< T > &_line) const
Equality operator.
Definition: Line2.hh:278
bool Intersect(const Line2< T > &_line, math::Vector2< T > &_pt, double _epsilon=1e-6) const
Check if this line intersects the given line segment. The point of intersection is returned in the _r...
Definition: Line2.hh:195
bool Collinear(const math::Vector2< T > &_pt, double _epsilon=1e-6) const
Check if the given point is collinear with this line.
Definition: Line2.hh:109
bool OnSegment(const math::Vector2< T > &_pt, double _epsilon=1e-6) const
Return whether the given point is on this line segment.
Definition: Line2.hh:149
A two dimensional line segment. The line is defined by a start and end point.
Definition: Line2.hh:35
bool equal(const T &_a, const T &_b, const T &_epsilon=T(1e-6))
check if two values are equal, within a tolerance
Definition: Helpers.hh:556
static const size_t IGN_ONE_SIZE_T
size_t type with a value of 1
Definition: Helpers.hh:230
double CrossProduct(const Vector2< T > &_pt) const
Return the cross product of this line and the given point. Given 'a' and 'b' as the start and end poi...
Definition: Line2.hh:95
T min(T... args)
bool Collinear(const math::Line2< T > &_line, double _epsilon=1e-6) const
Check if the given line is collinear with this line. This is the AND of Parallel and Intersect...
Definition: Line2.hh:137
double CrossProduct(const Line2< T > &_line) const
Return the cross product of this line and the given line. Give 'a' as this line and 'b' as given line...
Definition: Line2.hh:82
friend std::ostream & operator<<(std::ostream &_out, const Line2< T > &_line)
Stream extraction operator.
Definition: Line2.hh:303
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: Helpers.hh:227
T max(T... args)
bool Parallel(const math::Line2< T > &_line, double _epsilon=1e-6) const
Check if the given line is parallel with this line.
Definition: Line2.hh:123
void Set(const math::Vector2< T > &_ptA, const math::Vector2< T > &_ptB)
Set the start and end point of the line segment.
Definition: Line2.hh:58
Line2(const math::Vector2< T > &_ptA, const math::Vector2< T > &_ptB)
Constructor.
Definition: Line2.hh:40
static const double NAN_D
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:269
math::Vector2< T > operator[](size_t _index) const
Get the start or end point.
Definition: Line2.hh:294
Line2(double _x1, double _y1, double _x2, double _y2)
Constructor.
Definition: Line2.hh:50
Definition: Angle.hh:42
STL class.
bool Intersect(const Line2< T > &_line, double _epsilon=1e-6) const
Check if this line intersects the given line segment.
Definition: Line2.hh:180
T clamp(T _v, T _min, T _max)
Simple clamping function.
Definition: Helpers.hh:406
bool operator!=(const Line2< T > &_line) const
Inequality operator.
Definition: Line2.hh:286