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/geo/d3_simplex.h >

Types

d3_simplex::coord_type the coordinate type (double).

d3_simplex::point_type the point type (d3_point).

Creation

d3_simplex S(const d3_point& a, const d3_point& b, const d3_point& c, const 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.

d3_point S[int i] returns pi. Precondition i>0 and i<5.

int S.index(const 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(const d3_point& p)
    returns true, if p is contained in the simplex.

bool S.insphere(const 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(const d3_point& p, const d3_point& q, const d3_point& v)
    returns S reflected across the plane through (p,q,v).

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

d3_simplex S.translate(const 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 + const vector& v returns S translated by vector v.

d3_simplex S - const 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