Definition
An instance l of the data type d3_rat_line is a directed straight line in three-dimensional space.
#include < LEDA/geo/d3_rat_line.h >
Creation
d3_rat_line | l(const d3_rat_point& p1, const d3_rat_point& p2) | |
introduces a variable l of type d3_rat_line. l is initialized to the line through points p1,p2. | ||
d3_rat_line | l(const d3_rat_segment& s) | |
introduces a variable l of type d3_rat_line. l is initialized to the line supporting segment s. | ||
d3_rat_line | l | introduces a variable l of type d3_rat_line. l is initialized to the line through points (0,0,0,1) and (1,0,0,1). |
Operations
d3_line | l.to_float() | returns a floating point approximation of l. |
bool | l.contains(const d3_rat_point& p) | |
returns true if p lies on l. | ||
d3_rat_point | l.point1() | returns a point on l. |
d3_rat_point | l.point2() | returns a second point on l. |
d3_rat_segment | l.seg() | returns a segment on l. |
bool | l.project_xy(rat_line& m) | if the projection of l into the xy plane is not a point, the function returns true and assignes the projection to m. Otherwise false is returned. |
bool | l.project_xz(rat_line& m) | if the projection of l into the xz plane is not a point, the function returns true and assignes the projection to m. Otherwise false is returned. |
bool | l.project_yz(rat_line& m) | if the projection of l into the yz plane is not a point, the function returns true and assignes the projection to m. Otherwise false is returned. |
bool | l.project(const d3_rat_point& p, const d3_rat_point& q, const d3_rat_point& v, d3_rat_line& m) | |
if the projection of l into the plane through (p,q,v) is not a point, the function returns true and assignes the projection to m. Otherwise false is returned. | ||
d3_rat_line | l.translate(integer dx, integer dy, integer dz, integer dw) | |
returns l translated by vector (dx/dw,dy/dw,dz/dw). | ||
d3_rat_line | l.translate(rat_vector v) | returns l translated by v.
Precond.: v.dim()=3. |
d3_rat_line | l + const rat_vector& v | returns l translated by vector v. |
d3_rat_line | l - const rat_vector& v | returns l translated by vector - v. |
d3_rat_line | l.reflect(const d3_rat_point& p, const d3_rat_point& q, const d3_rat_point& v) | |
returns l reflected across the plane through (p,q,v). | ||
d3_rat_line | l.reflect(const d3_rat_point& p) | |
returns l reflected across point p. | ||
d3_rat_line | l.reverse() | returns l reversed. |
rat_vector | l.to_vector() | returns point2()-point1(). |
bool | l.intersection(const d3_rat_segment& s) | |
decides, whether l and s intersect in a single point. | ||
bool | l.intersection(const d3_rat_segment& s, d3_rat_point& p) | |
decides, whether l and s intersect in a single point. If so, the point of intersection is assigned to p. | ||
bool | l.intersection(const d3_rat_line& m) | |
decides, whether l and m intersect in a single point. | ||
bool | l.intersection(const d3_rat_line& m, d3_rat_point& p) | |
decides, whether l and m intersect in a single point. If so, the point of intersection is assigned to p. | ||
rational | l.sqr_dist(const d3_rat_point& p) | |
returns the square of the distance between l and p. |