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.

double r.height( ) returns the height of r.<br />

bool r.is degenerate( ) returns true, if r degenerates to a segment or point<br />

(the 4 corners are collinear), false otherwise.<br />

bool r.is point( ) returns true, if r degenerates to a point.<br />

bool r.is segment( ) returns true, if r degenerates to a segment.<br />

int r.cs code(const point& p) returns the code for Cohen-Sutherland algorithm.<br />

bool r.inside(const point& p) returns true, if p is inside of r, false otherwise.<br />

bool r.outside(const point& p) returns true, if p is outside of r, false otherwise.<br />

bool r.inside or contains(const point& p)<br />

returns true, if p is inside of r or on the border,<br />

false otherwise.<br />

bool<br />

r.contains(const point& p) returns true, if p is on the border of r, false otherwise.<br />

region kind r.region of(const point& p)<br />

returns BOUNDED REGION if p lies in the<br />

bounded region of r, returns ON REGION if p lies<br />

on r, and returns UNBOUNDED REGION if p lies<br />

in the unbounded region.<br />

rectangle r.include(const point& p) returns a new rectangle that includes the points of<br />

r and p.<br />

rectangle r.include(const rectangle& r2 )<br />

returns a new rectangle that includes the points of<br />

r and r2.<br />

rectangle<br />

r.translate(double dx, double dy)<br />

returns a new rectangle that is the translation of<br />

r by (dx, dy).<br />

rectangle r.translate(const vector& v)<br />

returns a new rectangle that is the translation of<br />

r by v.<br />

rectangle r + const vector& v returns r translated by v.<br />

rectangle r − const vector& v returns r translated by −v.<br />

point r[int i] returns the i − th vertex of r. Precondition: (0 <<br />

i < 5).

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

Saved successfully!

Ooh no, something went wrong!