STIRA  0.1
Public Member Functions | List of all members
stira::common::LineSegment< T > Class Template Reference

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...
 

Detailed Description

template<class T>
class stira::common::LineSegment< T >

A class to represent a 2D line segment by a point couple.

Member Function Documentation

template<class T >
double stira::common::LineSegment< T >::GetDistanceToLine ( Point< T >  p,
bool  isSegment = false 
)

gets distance of point p to the line

Parameters
ppoint to get distance of
isSegmentflag 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.

The documentation for this class was generated from the following file: