Line_2< T > Class Template Reference

A line in 2-D. More...

#include <Line_2.h>

List of all members.

Public Types

typedef T Number
 The number type.
typedef SegmentMath< 2, T > Segment
 The segment upon which this line is built.
typedef Segment::Point Point
 The point type.

Public Member Functions

Constructors etc.

 Line_2 ()
 Default constructor. Uninitialized memory.
 Line_2 (const Point &source, const Point &target)
 Construct from points.
void make (const Point &source, const Point &target)
 Make from points.
 Line_2 (const Segment &segment)
 Construct from a segment.
 Line_2 (const geom::Segment< 2, Number > &segment)
 Construct from a Segment<2,Number>.
 Line_2 (const Line_2 &other)
 Copy constructor.
Line_2operator= (const Line_2 &other)
 Assignment operator.
 ~Line_2 ()
 Trivial destructor.
Accesors.

const PointgetPointOn () const
 Return a point on the line.
const PointgetTangent () const
 Return the tangent to the line.
const PointgetNormal () const
 Return the normal to the line.
const SegmentgetSegment () const
 Return the segment on which the line is built.
Mathematical operations.

Line_2operator+= (const Point &p)
 Translate the line by p.
Line_2operator-= (const Point &p)
 Translate the line by -p.
Number computeSignedDistance (const Point &p) const
 Distance to the line.
Number computeSignedDistanceAndClosestPoint (const Point &p, Point *cp) const
 Distance and closest point to the line.
void computeIntersection (Point p1, Point p2, Point *intersectionPoint) const
 Compute the point where the line through p1 and p2 intersects this line.

Related Functions

(Note that these are not member functions.)



template<typename T >
const Line_2< T > & operator+ (const Line_2< T > &x)
 Unary positive operator.
template<typename T >
Line_2< T > operator- (const Line_2< T > &x)
 Unary negative operator.
template<typename T >
std::istream & operator>> (std::istream &in, Line_2< T > &x)
 Read a line.
template<typename T >
std::ostream & operator<< (std::ostream &out, const Line_2< T > &x)
 Write a line.
template<typename T >
bool operator== (const Line_2< T > &a, const Line_2< T > &b)
 Return true if the lines are equal.
template<typename T >
bool operator!= (const Line_2< T > &a, const Line_2< T > &b)
 Return true if the lines are not equal.

Detailed Description

template<typename T = double>
class Line_2< T >

A line in 2-D.

Parameters:
T is the number type. By default it is double.

Friends And Related Function Documentation

template<typename T >
bool operator!= ( const Line_2< T > &  a,
const Line_2< T > &  b 
) [related]

Return true if the lines are not equal.

template<typename T >
const Line_2< T > & operator+ ( const Line_2< T > &  x  )  [related]

Unary positive operator.

template<typename T >
Line_2< T > operator- ( const Line_2< T > &  x  )  [related]

Unary negative operator.

References Line_2< T >::getSegment().

template<typename T >
std::ostream & operator<< ( std::ostream &  out,
const Line_2< T > &  x 
) [related]

Write a line.

References Line_2< T >::getSegment().

template<typename T >
bool operator== ( const Line_2< T > &  a,
const Line_2< T > &  b 
) [related]

Return true if the lines are equal.

References Line_2< T >::getSegment().

template<typename T >
std::istream & operator>> ( std::istream &  in,
Line_2< T > &  x 
) [related]

Read a line.


The documentation for this class was generated from the following file:
Generated on Thu Jun 30 02:14:58 2016 for Computational Geometry Package by  doxygen 1.6.3