Definition
An instance P of the data type d3_rat_plane is an oriented rational plane in the three-dimensional space R ^3. It can be defined by a tripel (a,b,c) of non-collinear rational points or a single rational point a and a normal vector v.
Creation
d3_rat_plane | p; | introduces a variable p of type d3_rat_plane initialized to the trivial plane. |
d3_rat_plane |
p(d3_rat_point a, d3_rat_point b, d3_rat_point c); | |
introduces a variable p of type d3_rat_plane initialized to
the plane through (a,b,c).
Precondition: a, b, and c are not collinear. |
||
d3_rat_plane | p(d3_rat_point a, rat_vector v); | |
introduces a variable p of type d3_rat_plane initialized
to the plane that contains a with normal vector v.
Precondition: v.dim() = 3 and v.length() > 0. |
||
d3_rat_plane | p(d3_rat_point a, d3_rat_point b); | |
introduces a variable p of type d3_rat_plane initialized to the plane that contains a with normal vector b-a. | ||
|
Operations
d3_rat_point | p.point1() | returns a point of p. |
rat_vector | p.normal() | returns a normal vector of p. |
d3_plane | p.to_d3_plane() | returns a floating point approximation of p. |
rational | p.sqr_dist(d3_rat_point q) | |
returns the square of the Euclidean distance between p and q. | ||
rat_vector | p.normal_project(d3_rat_point q) | |
returns the vector pointing from q to its projection on p along the normal direction. | ||
d3_rat_plane | p.translate(rational dx, rational dy, rational dz) | |
returns p translated by vector (dx,dy,dz). | ||
d3_rat_plane | p.translate(integer dx, integer dy, integer dz, integer dw) | |
returns p translated by vector (dx/dw,dy/dw,dz/dw). | ||
d3_rat_plane | p.translate(rat_vector v) | returns p+v, i.e., p translated by vector v.
Precondition: v.dim() = 3. |
d3_rat_plane | p + rat_vector v | returns p translated by vector v. |
d3_rat_plane | p.reflect(d3_rat_plane Q) | returns p reflected across plane Q. |
d3_rat_plane | p.reflect(d3_rat_point q) | returns p reflected across point q. |
d3_rat_point | p.reflect_point(d3_rat_point q) | |
returns q reflected across plane p. | ||
int | p.side_of(d3_rat_point q) | computes the side of p on which q lies. |
bool | p.contains(d3_rat_point q) | |
returns true if point q lies on plane p, i.e., (p.side_of(q) == 0), and false otherwise . | ||
bool | p.parallel(d3_rat_plane Q) | |
returns true if planes p and Q are parallel, and false otherwise. | ||
ostream& | ostream& O << p | writes p to output stream O. |
istream& | istream& I >> d3_rat_plane& p | |
reads p from input stream I. |
Non-Member Functions
int | orientation(d3_rat_plane p, d3_rat_point q) | |
computes the orientation of p.sideof(q). |