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

1. Definition<br />

An instance r of the data type d3 ray is a directed straight ray in three-dimensional space.<br />

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

2. Creation<br />

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

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

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

d3 ray<br />

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

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

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

r is initialized to<br />

3. Operations<br />

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

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

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

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

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

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

bool<br />

bool<br />

bool<br />

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

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

r.intersection(const d3 segment& s, d3 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 ray& r, d3 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.<br />

r.project xy(ray& m) if the projection of r into the xy plane is not a point,<br />

the function returns true and assignes the projection<br />

to m. Otherwise false is returned.

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

Saved successfully!

Ooh no, something went wrong!