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.

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

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

double p.zdist(const d3 point& q)<br />

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

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

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

d3 point<br />

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

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

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

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

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

d3 point p + const vector& v returns p translated by vector v.<br />

d3 point p − const vector& v returns p translated by vector −v.<br />

d3 point p.reflect(const d3 point& q, const d3 point& r, const d3 point& s)<br />

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

returns p reflected across the plane passing through q, r<br />

and s.<br />

returns p reflected across point q.<br />

vector<br />

ostream&<br />

istream&<br />

p − const d3 point& q<br />

ostream& O ≪ const d3 point& p<br />

istream& I ≫ d3 point& p<br />

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

writes p to output stream O.<br />

reads the coordinates of p (three double numbers) from<br />

input stream I.<br />

Non-Member Functions<br />

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

const d3 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 />

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

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

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

Saved successfully!

Ooh no, something went wrong!