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.

14.3 Straight Rays ( ray )<br />

1. Definition<br />

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

<strong>The</strong> angle between a right oriented horizontal ray and r is called the direction of r.<br />

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

2. Types<br />

ray :: coord type<br />

ray :: point type<br />

the coordinate type (double).<br />

the point type (point).<br />

3. Creation<br />

ray r(const point& p, const point& q);<br />

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

starting at point p and passing through point q.<br />

ray r(const segment& s); introduces a variable r of type ray.<br />

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

r is initialized to<br />

ray r(const point& p, const vector& v);<br />

ray r(const point& p, double alpha);<br />

introduces a variable r of type ray. r is initialized to ray(p, p+<br />

v).<br />

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

starting at point p with direction alpha.<br />

ray r;<br />

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

starting at the origin with direction 0.<br />

ray r(const ray& r1 , int);<br />

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

of r 1 . <strong>The</strong> second argument is for compatibility with rat ray.<br />

4. Operations<br />

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

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

point r.point2( ) returns a point on r different from r.source( ).

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

Saved successfully!

Ooh no, something went wrong!