10 #include "../BasicDatatypes.hpp" 56 Line2D(
float x1,
float y1,
float x2,
float y2)
62 Line2D(
const std::pair<Point2D, Point2D>& p)
187 Point2D* intersectingPoint = NULL)
const;
IntersectingType
Describes how two lines can be intersecting.
const Point2D & getP1() const
Returns the first point.
Line2D()
Empty constructor.
double distanceToPoint(const Point2D &point) const
Returns the distance of the given point to its orthogonal projection onto this line.
void setP1(const Point2D &p1)
Sets the first point.
Point2D second
The second point of this line.
Line2D(const Point2D &a, const Point2D &b)
Constructor with two points.
bool containsPoint(const Point2D &point) const
Returns true if this line "contains" the given point.
Point2D second_type
Typedef for STL std::pair compatibility.
Point2D first_type
Typedef for STL std::pair compatibility.
Point2D getDiff() const
Returns the difference between line end and line start as a Point2D.
The lines are not intersecting, i.e. they are parallel or zero.
Polygon2D toPolygon2D() const
Conversion to Polygon2D.
Point2D projectOntoLine(const Point2D &point) const
A line in the two-dimensional plane, composed out of two points.
Point2D value_type
Typedef for STL compatibility.
Point2D first
The first point of this line.
static Line2D fromLinearRegression(const Polygon2D &points)
Returns a Line2D from several points using linear regression.
double distanceFromLineSegment(const Point2D &point) const
Returns the distance of a point to this line segment.
bool isZero() const
Returns true if both points are zero.
The lines are intersecting, but outside of their line segments.
IntersectingType isIntersecting(const Line2D &other, Point2D *intersectingPoint=NULL) const
Calculates the intersection point between two lines.
Line2D(const std::pair< Point2D, Point2D > &p)
Constructor from a std::pair.
Line2D(float x1, float y1, float x2, float y2)
Constructor with x/y coordinates of the two points given explicitly.
The lines are intersecting within their line segments.
Point2D getCenterPoint() const
Returns the point in the middle between first and second point.
void setP2(const Point2D &p2)
Sets the second point.
virtual const UINT32 getUsedMemory() const
Line2D getUnitVector() const
Returns a unit vector for this line.
std::ostream & operator<<(std::ostream &os, const EvalCaseResult &result)
const Point2D & getP2() const
Returns the second point.
double inclination() const
double getInclination() const