A line in 2-D. More...
#include <Line_2.h>
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_2 & | operator= (const Line_2 &other) |
| Assignment operator. | |
| ~Line_2 () | |
| Trivial destructor. | |
Accesors. | |
| const Point & | getPointOn () const |
| Return a point on the line. | |
| const Point & | getTangent () const |
| Return the tangent to the line. | |
| const Point & | getNormal () const |
| Return the normal to the line. | |
| const Segment & | getSegment () const |
| Return the segment on which the line is built. | |
Mathematical operations. | |
| Line_2 & | operator+= (const Point &p) |
Translate the line by p. | |
| Line_2 & | operator-= (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. | |
A line in 2-D.
| T | is the number type. By default it is double. |
Return true if the lines are not equal.
Unary positive operator.
Unary negative operator.
References Line_2< T >::getSegment().
| std::ostream & operator<< | ( | std::ostream & | out, | |
| const Line_2< T > & | x | |||
| ) | [related] |
Write a line.
References Line_2< T >::getSegment().
Return true if the lines are equal.
References Line_2< T >::getSegment().
| std::istream & operator>> | ( | std::istream & | in, | |
| Line_2< T > & | x | |||
| ) | [related] |
Read a line.
1.6.3