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.

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

rat rectangle r.translate(rational dx, rational dy)<br />

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

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

of r and r2.<br />

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

returns r translated by v.<br />

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

rat rectangle r − const rat vector& v<br />

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

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

i < 5).<br />

rat rectangle r.rotate90(const rat point& p, int i = 1)<br />

rat rectangle r.rotate90(int i = 1)<br />

rat rectangle r.reflect(const rat point& p)<br />

returns r rotated about q by an angle of i × 90<br />

degrees. If i > 0 the rotation is counter-clockwise<br />

otherwise it is clockwise.<br />

returns r rotated by an angle of i × 90 degrees<br />

about the origin.<br />

returns r reflected across p.<br />

bool<br />

bool<br />

bool<br />

r.clip(const rat segment& t, rat segment& inter)<br />

clips t on r and returns the result in inter.<br />

r.clip(const rat line& l, rat segment& inter)<br />

clips l on r and returns the result in inter.<br />

r.clip(const rat ray& ry, rat segment& inter)<br />

clips ry on r and returns the result in inter.<br />

bool r.difference(const rat rectangle& q, list& L)<br />

returns true iff the difference of r and q is not<br />

empty, and false otherwise. <strong>The</strong> difference L is<br />

returned as a partition into rectangles.<br />

list r.intersection(const rat segment& s)<br />

returns r ∩ s.<br />

list r.intersection(const rat line& l)<br />

returns r ∩ l.

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

Saved successfully!

Ooh no, something went wrong!