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.9 Iso-oriented Rectangles ( rectangle )<br />

1. Definition<br />

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

plane.<br />

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

2. Creation<br />

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

introduces a variable r of type rectangle.<br />

rectangle with diagonal corners p and q<br />

r is initialized to the<br />

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

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

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

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

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

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

3. Operations<br />

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

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

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

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

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

list r.vertices( )<br />

returns the vertices of r in counterclockwise order<br />

starting from the lower left point.<br />

double r.xmin( ) returns the minimal x-coordinate of r.<br />

double r.xmax( ) returns the maximal x-coordinate of r.<br />

double r.ymin( ) returns the minimal y-coordinate of r.<br />

double r.ymax( ) returns the maximal y-coordinate of r.<br />

double r.width( ) returns the width of r.

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

Saved successfully!

Ooh no, something went wrong!