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

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

real vector p − const real point& q<br />

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

through q and r.<br />

returns p reflected across point q.<br />

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

Non-Member Functions<br />

int cmp distances(const real point& p1 , const real point& p2 ,<br />

const real point& p3 , const real point& p4 )<br />

compares the distances (p1 , p2 ) and (p3 , p4 ). Returns<br />

+1 (−1) if distance (p1 , p2 ) is larger (smaller) than distance<br />

(p3 , p4 ), otherwise 0.<br />

real point center(const real point& a, const real point& b)<br />

returns the center of a and b, i.e. a + ⃗ ab/2.<br />

real point midpoint(const real point& a, const real point& b)<br />

returns the center of a and b.<br />

int orientation(const real point& a, const real point& b, const real point& c)<br />

computes the orientation of points a, b, and c as the<br />

sign of the determinant<br />

∣<br />

a x a y 1<br />

b x b y 1<br />

c x c y 1<br />

∣<br />

i.e., it returns +1 if point c lies left of the directed line<br />

through a and b, 0 if a,b, and c are collinear, and −1<br />

otherwise.<br />

int cmp signed dist(const real point& a, const real point& b, const real point& c,<br />

const real point& d)<br />

compares (signed) distances of c and d to the straight<br />

line passing through a and b (directed from a to b). Returns<br />

+1 (−1) if c has larger (smaller) distance than d<br />

and 0 if distances are equal.

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

Saved successfully!

Ooh no, something went wrong!