Navigation: Up, Table of Contents, Bibliography, Index, Title Page

3D Line (CGAL_Line_3)

Definition

An object l of the data type CGAL_Line_3 is a directed straight line in the three-dimensional Euclidean space E3.

#include <CGAL/Line_3.h>

Creation

CGAL_Line_3<R> l ( CGAL_Point_3<R> p, CGAL_Point_3<R> q);
introduces a line l passing through the points p and q. Line l is directed from p to q.

CGAL_Line_3<R> l ( CGAL_Point_3<R> p, CGAL_Direction_3<R> d);
introduces a line l passing through point p with direction d.

CGAL_Line_3<R> l ( CGAL_Segment_3<R> s);
returns the line supporting the segment s, oriented from source to target.

CGAL_Line_3<R> l ( CGAL_Ray_3<R> r);
returns the line supporting the ray r, with the same orientation.

Operations

bool l == h Test for equality: two lines are equal, iff they have a non empty intersection and the same direction.
bool l != h Test for inequality.
CGAL_Point_3<R> l.projection ( CGAL_Point_3<R> p)
returns the orthogonal projection of p on l.
CGAL_Point_3<R> l.point ( int i) returns an arbitrary point on l. It holds point(i) == point(j), iff i==j.

Predicates

bool l.is_degenerate () returns true if line l is degenerated to a point.
bool l.has_on ( CGAL_Point_3<R> p)

Miscellaneous

CGAL_Plane_3<R> l.perpendicular_plane ( CGAL_Point_3<R> p)
returns the plane perpendicular to l passing through p.
CGAL_Line_3<R> l.opposite () returns the line with opposite direction.
CGAL_Direction_3<R>
l.direction () returns the direction of l.
CGAL_Line_3<R> l.transform ( CGAL_Aff_transformation_3<R> t)
returns the line obtained by applying t on a point on l and the direction of l.


Next: Class declaration of CGAL_Ray_3<R>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. Wed, January 20, 1999.