next up previous contents index
Next: 3D Convex Hull Algorithms Up: Basic Data Types for Previous: Rational Points in 3D-Space

     
Rational Planes ( d3_rat_plane )

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.

#include < LEDA/d3 _rat _plane.h >

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.
int  p.intersection(const d3_rat_point p1, const d3_rat_point p2, d3_rat_point& q)
    if the line l through p1 and p2 intersects p in a single point this point is assigned to q and the result is 1, if l and p do not intersect the result is 0, and if l is contained in p the result is 2.
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).


next up previous contents index
Next: 3D Convex Hull Algorithms Up: Basic Data Types for Previous: Rational Points in 3D-Space
LEDA research project
1999-04-23