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.6 Spheres in 3D-Space ( d3 sphere )<br />

1. Definition<br />

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

defined by four points p1 , p2 , p3 , p4 (d3 points).<br />

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

2. Creation<br />

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

const d3 point& p4 );<br />

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

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

3. Operations<br />

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

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

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

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

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

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

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

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

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

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

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

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

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

double S.radius( ) returns the radius.<br />

double S.surface( ) returns the size of the surface.<br />

double S.volume( ) returns the volume of the sphere.<br />

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

returns S translated by vector v.

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

Saved successfully!

Ooh no, something went wrong!