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.16 Iso-oriented Rational Rectangles (<br />

rat rectangle )<br />

1. Definition<br />

An instance r of the data type rectangle is an iso-oriented rectangle in the two-dimensional<br />

plane with rational coordinates.<br />

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

2. Creation<br />

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

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

rat rectangle with diagonal corners p and q<br />

rat rectangle r(const rat point& p, rational w, rational h);<br />

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

rat rectangle with lower left corner p, width w and height h.<br />

rat rectangle r(rational x1 , rational y1 , rational x2 , rational y2 );<br />

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

rat rectangle with diagonal corners (x1 , y1 ) and (x2 , y2 ).<br />

rat rectangle r(const rectangle& r, int prec = rat point :: default precision);<br />

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

rectangle obtained by approximating the defining points of r.<br />

3. Operations<br />

rectangle r.to float( ) returns a floating point approximation of R.<br />

void r.normalize( ) simplifies the homogenous representation by calling<br />

p.normalize( ) for every vertex of r.<br />

rat point r.upper left( ) returns the upper left corner.<br />

rat point r.upper right( ) returns the upper right corner.<br />

rat point r.lower left( ) returns the lower left corner.<br />

rat point r.lower right( ) returns the lower right corner.<br />

rat point r.center( ) returns the center of r.

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

Saved successfully!

Ooh no, something went wrong!