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.

int orientation(const d3 rat point& a, const d3 rat point& b,<br />

const d3 rat point& c, const d3 rat point& d)<br />

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

sign of the determinant<br />

∣<br />

∣<br />

a w b w c w d w ∣∣∣∣∣∣∣∣<br />

a x b x c x d x<br />

a y b y c y d y<br />

a z b z c z d z<br />

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

plane through a, b, c, 0 if a,b, c and d are coplanar, and<br />

−1 otherwise.<br />

int orientation xy(const d3 rat point& a, const d3 rat point& b,<br />

const d3 rat point& c)<br />

returns the orientation of the projections of a, b and c<br />

into the xy-plane.<br />

int orientation yz(const d3 rat point& a, const d3 rat point& b,<br />

const d3 rat point& c)<br />

returns the orientation of the projections of a, b and c<br />

into the yz-plane.<br />

int orientation xz(const d3 rat point& a, const d3 rat point& b,<br />

const d3 rat point& c)<br />

returns the orientation of the projections of a, b and c<br />

into the xz-plane.<br />

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

const d3 rat point& p3 , const d3 rat point& p4 )<br />

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

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

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

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

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

rational volume(const d3 rat point& a, const d3 rat point& b,<br />

const d3 rat point& c, const d3 rat point& d)<br />

computes the signed volume of the simplex determined<br />

by a,b,c, and d, positive if orientation(a, b, c, d) > 0<br />

and negative otherwise.<br />

bool collinear(const d3 rat point& a, const d3 rat point& b,<br />

const d3 rat point& c)<br />

returns true if points a, b, c are collinear, and false<br />

otherwise.

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

Saved successfully!

Ooh no, something went wrong!