l : ax + by + c = 0
The line splits in a positive and a negative side.[^1] A point with Cartesian coordinates is on the positive side of l, iff a px + b py + c > 0, it is on the negative side of l, iff a px + b py + c < 0.
#include <CGAL/Line_2.h>
| |
introduces a line l with the line equation in Cartesian
coordinates .
| |
| |
introduces a line l passing through the points
and . Line l is directed from
to .
| |
| |
introduces a line l passing through point
with direction .
| |
| |
introduces a line l supporting the segment ,
oriented from source to target.
| |
| |
introduces a line l supporting the ray , with
same orientation.
|
|
| Test for equality: two lines are equal, iff they have a non empty intersection and the same direction. |
|
| Test for inequality. |
|
| returns the first coefficient of . |
|
| returns the second coefficient of . |
|
| returns the third coefficient of . |
|
| returns an arbitrary point on l. It holds point(i) == point(j), iff i==j. Furthermore, l is directed from point(i) to point(j), for all i j. |
|
| |
returns the orthogonal projection of onto l. | ||
|
| |
returns the -coordinate of the point at l with
given -coordinate.
Precondition: l is not horizontal. | ||
|
| |
returns the -coordinate of the point at l with
given -coordinate.
Precondition: l is not vertical. |
|
| line l is degenerate, if the coefficients a and b of the line equation are zero. |
|
|
|
|
|
|
|
| |
returns CGAL_ON_ORIENTED_BOUNDARY, CGAL_ON_NEGATIVE_SIDE, or the constant CGAL_ON_POSITIVE_SIDE, depending on the position of relative to the oriented line l. |
For convenience we provide the following boolean functions:
|
| |
|
| |
returns has_on(). | ||
|
| |
|
|
| ||
| returns the direction of l. | |
|
| returns the line with opposite direction. |
|
| |
returns the line perpendicular to l and passing through , where the direction is the direction of l rotated counterclockwise by 90 degrees. | ||
|
| |
returns the line obtained by applying on a point on l and the direction of l. |
CGAL_Point_2< CGAL_Cartesian<double> > p(1.0,1.0), q(4.0,7.0);
To define a line we write:
CGAL_Line_2< CGAL_Cartesian<double> > l(p,q);