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.26 Point Generators ( point generators )<br />

All generators are available for point, rat point, real point, d3 point, and d3 rat point.<br />

We use POINT to stand for any of these classes. <strong>The</strong> corresponding header files are<br />

called random point.h, random rat point.h, random real point.h, random d3 point.h, and<br />

random d3 rat point.h, respectively. <strong>The</strong>se header files are included in the corresponding<br />

kernel header files, e.g., random rat point.h is part of rat kernel.h.<br />

We use the following naming conventions: square, circle, segment, and disk refer to twodimensional<br />

objects (even in 3d) and cube, ball, and sphere refer to full-dimensional<br />

objects, i.e, in 2d cube and square, ball and disk, and circle and sphere are synonymous.<br />

void<br />

random point in square(POINT & p, int maxc)<br />

returns a point whose x and y-coordinates are random<br />

integers in [−maxc .. maxc]. <strong>The</strong> z-coordinate is zero.<br />

void random points in square(int n, int maxc, list& L)<br />

returns a list L of n points . . . .<br />

void random point in unit square(POINT & p, int D = (1 ≪ 30) − 1)<br />

returns a point whose coordinates are random rationals<br />

of the form i/D where i is a random integer in<br />

the range [0 .. D]. <strong>The</strong> default value of D is 2 30 − 1.<br />

void random points in unit square(int n, int D, list& L)<br />

returns a list L of n points . . . .<br />

void random points in unit square(int n, list& L)<br />

void<br />

returns a list L of n points . . . . <strong>The</strong> default value of<br />

D is used.<br />

random point in cube(POINT & p, int maxc)<br />

returns a point whose coordinates are random integers<br />

in [−maxc .. maxc]. In 2d this function is equivalent<br />

to random point in square.<br />

void random points in cube(int n, int maxc, list& L)<br />

returns a list L of n points . . . .<br />

void random point in unit cube(POINT & p, int D = (1 ≪ 30) − 1)<br />

returns a point whose coordinates are random rationals<br />

of the form i/D where i is a random integer in<br />

the range [0 .. D]. <strong>The</strong> default value of D is 2 30 − 1.<br />

void random points in unit cube(int n, int D, list& L)<br />

returns a list L of n points . . . .

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

Saved successfully!

Ooh no, something went wrong!