next up previous contents index
Next: Rational Points in 3D-Space Up: Basic Data Types for Previous: Spheres in 3D-Space (   Contents   Index


Simplices in 3d space ( d3_simplex )

Definition

An instance of the data type d3_simplex is a simplex in 3d space. The simplex is defined by four points p1,p2,p3,p4 (d3_points). We call the simplex degenerate, if the four defining points are coplanar.

#include < LEDA/d3 _simplex.h >

Creation

d3_simplex S(d3_point a, d3_point b, d3_point c, d3_point d)
    creates the simplex (a,b,c,d).

d3_simplex S creates the simplex ((0,0,0),(1,0,0),(0,1,0),(0,0,1)).

Operations

d3_point S.point1() returns p1.

d3_point S.point2() returns p2.

d3_point S.point3() returns p3.

d3_point S.point4() returns p4.

int S.index(d3_point p) returns 1 if p==p1, 2 if p==p2, 3 if p==p3, 4 if p==p4, and 0 otherwise.

bool S.is_degenerate() returns true if S is degenerate and false otherwise.

d3_sphere S.circumscribing_sphere() returns a d3_sphere through (p1,p2,p3,p4) (precondition: the d3_simplex is not degenerate).

bool S.in_simplex(d3_point p) returns true, if p is contained in the simplex.

bool S.insphere(d3_point p) returns true, if p lies in the interior of the sphere through p1,p2,p3,p4.

double S.vol() returns the signed volume of the simplex.

d3_simplex S.reflect(d3_point p, d3_point q, d3_point v)
    returns S reflected across the plane through (p,q,v).

d3_simplex S.reflect(d3_point p) returns S reflected across point p.

d3_simplex S.translate(vector v) returns S translated by vector v.
Precond.: v.dim()=3.

d3_simplex S.translate(double dx, double dy, double dz)
    returns S translated by vector (dx,dy,dz).

d3_simplex S + vector v returns S translated by vector v.

d3_simplex S - vector v returns S translated by vector - v.


next up previous contents index
Next: Rational Points in 3D-Space Up: Basic Data Types for Previous: Spheres in 3D-Space (   Contents   Index
LEDA research project
2000-02-09