gz/math/Line2.hh
friend std::ostream & operator<<(std::ostream &_out, const Line2< T > &_line)
Stream extraction operator.
Definition: gz/math/Line2.hh:303
Definition: gz/math/AdditivelySeparableScalarField3.hh:27
bool equal(const T &_a, const T &_b, const T &_epsilon=T(1e-6))
check if two values are equal, within a tolerance
Definition: gz/math/Helpers.hh:556
math::Vector2< T > operator[](size_t _index) const
Get the start or end point.
Definition: gz/math/Line2.hh:294
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: gz/math/Line2.hh:95
bool Collinear(const math::Vector2< T > &_pt, double _epsilon=1e-6) const
Check if the given point is collinear with this line.
Definition: gz/math/Line2.hh:109
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: gz/math/Line2.hh:137
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: gz/math/Line2.hh:162
A two dimensional line segment. The line is defined by a start and end point.
Definition: gz/math/Line2.hh:35
void Set(const math::Vector2< T > &_ptA, const math::Vector2< T > &_ptB)
Set the start and end point of the line segment.
Definition: gz/math/Line2.hh:58
STL class.
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: gz/math/Line2.hh:195
bool OnSegment(const math::Vector2< T > &_pt, double _epsilon=1e-6) const
Return whether the given point is on this line segment.
Definition: gz/math/Line2.hh:149
void Set(double _x1, double _y1, double _x2, double _y2)
Set the start and end point of the line segment.
Definition: gz/math/Line2.hh:70
T clamp(T _v, T _min, T _max)
Simple clamping function.
Definition: gz/math/Helpers.hh:406
Line2(double _x1, double _y1, double _x2, double _y2)
Constructor.
Definition: gz/math/Line2.hh:50
Line2(const math::Vector2< T > &_ptA, const math::Vector2< T > &_ptB)
Constructor.
Definition: gz/math/Line2.hh:40
T min(T... args)
bool operator!=(const Line2< T > &_line) const
Inequality operator.
Definition: gz/math/Line2.hh:286
double Slope() const
Get the slope of the line.
Definition: gz/math/Line2.hh:266
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: gz/math/Helpers.hh:227
bool Intersect(const Line2< T > &_line, double _epsilon=1e-6) const
Check if this line intersects the given line segment.
Definition: gz/math/Line2.hh:180
static const size_t IGN_ONE_SIZE_T
size_t type with a value of 1
Definition: gz/math/Helpers.hh:230
T max(T... args)
static const double NAN_D
Returns the representation of a quiet not a number (NAN)
Definition: gz/math/Helpers.hh:269
bool operator==(const Line2< T > &_line) const
Equality operator.
Definition: gz/math/Line2.hh:278
T Length() const
Get the length of the line.
Definition: gz/math/Line2.hh:256
bool Parallel(const math::Line2< T > &_line, double _epsilon=1e-6) const
Check if the given line is parallel with this line.
Definition: gz/math/Line2.hh:123
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: gz/math/Line2.hh:82