Definition
An instance of the data type d3_rat_simplex is a simplex in 3d space. The simplex is defined by four points p1,p2,p3,p4 with rational coordinates (d3_rat_points). We call the simplex degenerate, if the four defining points are coplanar.
#include < LEDA/d3 _rat _simplex.h >
Creation
d3_rat_simplex | S(d3_rat_point a, d3_rat_point b, d3_rat_point c, d3_rat_point d) | |
creates the simplex (a,b,c,d). | ||
d3_rat_simplex | S | creates the simplex ((0,0,0),(1,0,0),(0,1,0),(0,0,1) ). |
Operations
d3_simplex | S.to_d3_simplex() | returns a floating point approximation of S. |
d3_rat_point | S.point1() | returns p1. |
d3_rat_point | S.point2() | returns p2. |
d3_rat_point | S.point3() | returns p3. |
d3_rat_point | S.point4() | returns p4. |
int | S.index(d3_rat_point p) | returns 1 if p==p1, 2 if p==p2, 3 if p==p3, 4 if p==p4, 0 otherwise. |
bool | S.is_degenerate() | returns true if S is degenerate and false otherwise. |
d3_rat_sphere | S.circumscribing_sphere() | returns a d3_rat_sphere through (p1,p2,p3,p4) (precondition: the d3_rat_simplex is not degenerate). |
bool | S.in_simplex(d3_rat_point p) | |
returns true, if p is contained in the simplex. | ||
bool | S.insphere(d3_rat_point p) | |
returns true, if p lies in the interior of the sphere through p1,p2,p3,p4. | ||
rational | S.vol() | returns the signed volume of the simplex. |
d3_rat_simplex | S.reflect(d3_rat_point p, d3_rat_point q, d3_rat_point v) | |
returns S reflected across the plane through (p,q,v). | ||
d3_rat_simplex | S.reflect(d3_rat_point p) | returns S reflected across point p. |
d3_rat_simplex | S.translate(rat_vector v) | returns S translated by vector v.
Precond.: v.dim()=3. |
d3_rat_simplex | S.translate(rational dx, rational dy, rational dz) | |
returns S translated by vector (dx,dy,dz). | ||
d3_rat_simplex | S.translate(integer dx, integer dy, integer dz, integer dw) | |
returns S translated by vector (dx/dw,dy/dw,dz/w). | ||
d3_rat_simplex | S + rat_vector v | returns S translated by vector v. |
d3_rat_simplex | S - rat_vector v | returns S translated by vector - v. |