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.9 Straight Rational Rays in 3D-Space ( d3 rat ray<br />

)<br />

1. Definition<br />

An instance r of the data type d3 rat ray is a directed straight ray defined by two points<br />

with rational coordinates in three-dimensional space.<br />

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

2. Creation<br />

d3 rat ray r(const d3 rat point& p1 , const d3 rat point& p2 );<br />

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

starting at point p1 and going through p2 .<br />

d3 rat ray r(const d3 rat segment& s);<br />

introduces a variable r of type d3 rat ray.<br />

ray(s.source( ), s.target( )) .<br />

r is initialized to<br />

3. Operations<br />

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

d3 rat point r.point1( ) returns the source of r.<br />

d3 rat point r.point2( ) returns a point on r different from the source.<br />

d3 rat segment r.seg( ) returns a segment on r.<br />

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

returns true if p lies on r.<br />

bool r.contains(const d3 rat segment& s)<br />

bool<br />

bool<br />

returns true if s lies on r.<br />

r.intersection(const d3 rat segment& s, d3 rat point& inter)<br />

if s and r intersect in a single point, true is returned<br />

and the point of intersection is assigned to inter. Otherwise<br />

false is returned.<br />

r.intersection(const d3 rat ray& r, d3 rat point& inter)<br />

if r and r intersect in a single point, true is returned<br />

and the point of intersection is assigned to inter. Otherwise<br />

false is returned.

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

Saved successfully!

Ooh no, something went wrong!