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.

14.17 Real Points ( real point )<br />

1. Definition<br />

An instance of the data type real point is a point in the two-dimensional plane R 2 . We use<br />

(x, y) to denote a real point with first (or x-) coordinate x and second (or y-) coordinate<br />

y.<br />

#include < <strong>LEDA</strong>/geo/real point.h ><br />

2. Types<br />

real point :: coord type<br />

real point :: point type<br />

real point :: float type<br />

the coordinate type (real).<br />

the point type (real point).<br />

the corresponding floating-point type (point).<br />

3. Creation<br />

real point p; introduces a variable p of type real point initialized to the<br />

point (0, 0).<br />

real point<br />

p(real x, real y);<br />

introduces a variable p of type real point initialized to the<br />

point (x, y).<br />

real point p(const point& p1 , int prec = 0);<br />

real point p(const rat point& p1 );<br />

introduces a variable p of type real point initialized to the<br />

point p 1 . (<strong>The</strong> second argument is for compatibility with<br />

rat point.)<br />

introduces a variable p of type real point initialized to the<br />

point p 1 .<br />

real point<br />

p(double x, double y);<br />

introduces a variable p of type real point initialized to the real<br />

point (x, y).<br />

4. Operations<br />

real p.xcoord( ) returns the first coordinate of p.<br />

real p.ycoord( ) returns the second coordinate of p.

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

Saved successfully!

Ooh no, something went wrong!