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.

eal rectangle r.translate(real dx, real dy)<br />

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

real rectangle r + const real vector& v<br />

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

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

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

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

r by v.<br />

returns r translated by v.<br />

returns r translated by −v.<br />

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

i < 5).<br />

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

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

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

otherwise it is clockwise.<br />

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

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

about the origin.<br />

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

returns r reflected across p .<br />

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

returns r ∩ s .<br />

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

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

bool<br />

bool<br />

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

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

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

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

bool r.difference(const real 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 real line& l)<br />

returns r ∩ l.

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

Saved successfully!

Ooh no, something went wrong!