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.11 Rational Segments in 3D-Space (<br />

d3 rat segment )<br />

1. Definition<br />

An instance s of the data type d3 rat segment is a directed straight line segment in<br />

three-dimensional space, i.e., a line segment connecting two rational points p, q ∈ R 3 . p is<br />

called the source or start point and q is called the target or end point of s. A segment is<br />

called trivial if its source is equal to its target. If s is not trivial, we use line(s) to denote<br />

the straight line containing s.<br />

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

2. Creation<br />

d3 rat segment s(const d3 rat point& p1 , const d3 rat point& p2 );<br />

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

the segment through points p1 , p2 .<br />

d3 rat segment s;<br />

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

the segment through points (0, 0, 0, 1) and (1, 0, 0, 1).<br />

3. Operations<br />

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

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

decides whether s contains p.<br />

d3 rat point s.source( ) returns the source point of segment s.<br />

d3 rat point s.target( ) returns the target point of segment s.<br />

rational s.xcoord1( ) returns the x-coordinate of s.source().<br />

rational s.xcoord2( ) returns the x-coordinate of s.target().<br />

rational s.ycoord1( ) returns the y-coordinate of s.source().<br />

rational s.ycoord2( ) returns the y-coordinate of s.target().<br />

rational s.zcoord1( ) returns the z-coordinate of s.source().<br />

rational s.zcoord2( ) returns the z-coordinate of s.target().<br />

rational s.dx( ) returns xcoord2( ) − xcoord1( ).

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

Saved successfully!

Ooh no, something went wrong!