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.

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

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

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

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

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

returns the square of the Euclidean distance between p<br />

and q.<br />

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

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

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

real p.distance(const real point& q)<br />

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

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

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

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

real p.distance( ) returns the Euclidean distance between p and (0, 0).<br />

real point<br />

real point<br />

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

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

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

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

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

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

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

real point<br />

real point<br />

p + const real vector& v<br />

returns p translated by vector v.<br />

p − const real vector& v<br />

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

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

returns p rotated about q by an angle of i × 90 degrees.<br />

If i > 0 the rotation is counter-clockwise otherwise it is<br />

clockwise.<br />

real point p.rotate90(int i = 1) returns p.rotate90(real point(0, 0), i).

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

Saved successfully!

Ooh no, something went wrong!