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 point p.reflect(const rat point& p, const rat point& q)<br />

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

returns p reflected across the straight line passing through<br />

p and q.<br />

Precondition: p ≠ q.<br />

returns p reflected across point q.<br />

rat point<br />

rat point<br />

p.translate(const rational& dx, const rational& dy)<br />

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

p.translate(integer dx, integer dy, integer dw)<br />

returns p translated by vector (dx/dw, dy/dw).<br />

rat point p.translate(const rat vector& v)<br />

returns p + v, i.e., p translated by vector v.<br />

Precondition: v.dim() = 2.<br />

rat point<br />

rat point<br />

p + const rat vector& v<br />

returns p translated by vector v.<br />

p − const rat vector& v<br />

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

rational p.sqr dist(const rat point& q)<br />

returns the squared distance between p and q.<br />

int p.cmp dist(const rat point& q, const rat point& r)<br />

returns compare(p.sqr dist(q), p.sqr dist(r)).<br />

rational p.xdist(const rat point& q)<br />

returns the horizontal distance between p and q.<br />

rational p.ydist(const rat point& q)<br />

returns the vertical distance between p and q.<br />

int p.orientation(const rat point& q, const rat point& r)<br />

returns orientation(p, q, r) (see below).<br />

rational p.area(const rat point& q, const rat point& r)<br />

returns area(p, q, r) (see below).<br />

rat vector<br />

p − const rat point& q<br />

returns the difference vector of the coordinates.<br />

Non-Member Functions

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

Saved successfully!

Ooh no, something went wrong!