STIRA
0.1
|
A class to represent a 2D line segment by a point couple. More...
#include <LineSegment.h>
Public Member Functions | |
LineSegment (Point< T > point1, Point< T > point2) | |
Constructor. | |
~LineSegment () | |
destructor. | |
Point< T > | GetPoint1 () |
gets point 1 | |
void | SetPoint1 (Point< T > p) |
sets point 1 to p | |
Point< T > | GetPoint2 () |
gets point 2 | |
void | SetPoint2 (Point< T > p) |
sets point 2 to p | |
double | GetLength () |
gets the length of this line segment | |
double | GetDistanceToLine (Point< T > p, bool isSegment=false) |
gets distance of point p to the line More... | |
A class to represent a 2D line segment by a point couple.
double stira::common::LineSegment< T >::GetDistanceToLine | ( | Point< T > | p, |
bool | isSegment = false |
||
) |
gets distance of point p to the line
p | point to get distance of |
isSegment | flag if we compute the distance to the line defined by the points, or just the line segment between the points if isSegment is true, we compute the distance of the point to the nearest point of the line segment (which is limited by the two points) false we compute the distance to the (infinitely long) line that is defined by the two points. |