31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16.14 Rational Simplices ( d3 rat simplex )<br />

1. Definition<br />

An instance of the data type d3 rat simplex is a simplex in 3d space. <strong>The</strong> simplex is<br />

defined by four points p1 , p2 , p3 , p4 with rational coordinates (d3 rat points). We call<br />

the simplex degenerate, if the four defining points are coplanar.<br />

#include < <strong>LEDA</strong>/geo/d3 rat simplex.h ><br />

2. Types<br />

d3 rat simplex :: coord type the coordinate type (rational).<br />

d3 rat simplex :: point type<br />

the point type (d3 rat point).<br />

3. Creation<br />

d3 rat simplex S(const d3 rat point& a, const d3 rat point& b, const d3 rat point& c,<br />

const d3 rat point& d);<br />

creates the simplex (a, b, c, d).<br />

d3 rat simplex S; creates the simplex ((0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1) ).<br />

4. Operations<br />

d3 simplex S.to d3 simplex( ) returns a floating point approximation of S.<br />

d3 rat point S.point1( ) returns p1 .<br />

d3 rat point S.point2( ) returns p2 .<br />

d3 rat point S.point3( ) returns p3 .<br />

d3 rat point S.point4( ) returns p4 .<br />

d3 rat point S[int i] returns pi. Precondition: i > 0 and i < 5.<br />

int S.index(const d3 rat point& p)<br />

returns 1 if p == p1 , 2 if p == p2 , 3 if p == p3 , 4 if<br />

p == p4 , 0 otherwise.<br />

bool S.is degenerate( ) returns true if S is degenerate and false otherwise.<br />

d3 rat sphere S.circumscribing sphere( )<br />

returns a d3 rat sphere through (p1 , p2 , p3, p4 ) (precondition:<br />

the d3 rat simplex is not degenerate).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!