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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16.13 Rational Spheres ( d3 rat sphere )<br />

1. Definition<br />

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

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

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

2. Creation<br />

d3 rat sphere S(const d3 rat point& p1 , const d3 rat point& p2 ,<br />

const d3 rat point& p3 , const d3 rat point& p4 );<br />

introduces a variable S of type d3 rat sphere. S is initialized to the<br />

sphere through points p1 , p2 , p3, p4 .<br />

3. Operations<br />

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

bool S.contains(const d3 rat point& p)<br />

bool S.inside(const d3 rat point& p)<br />

bool S.outside(const d3 rat point& p)<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 />

returns true, if p is on the sphere, false otherwise.<br />

returns true, if p is inside the sphere, false otherwise.<br />

returns true, if p is outside the sphere, false otherwise.<br />

bool S.is degenerate( ) returns true, if the 4 defining points are coplanar.<br />

d3 rat point S.center( ) returns the center of the sphere.<br />

rational S.sqr radius( ) returns the square of the radius.<br />

d3 rat sphere S.translate(const rat vector& v)<br />

translates the sphere by vector v and returns a new<br />

d3 rat sphere.

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

Saved successfully!

Ooh no, something went wrong!