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 compare by angle(const rat vector& v1 , const rat vector& v2 )<br />

For a non-zero vector v let α(v) be the angle<br />

by which the positive x-axis has to be turned<br />

counter-clockwise until it aligns with v. <strong>The</strong><br />

function compares the angles defined by v1<br />

and v2 , respectively. <strong>The</strong> zero-vector precedes<br />

all non-zero vectors in the angle-order.<br />

rat vector cross product(const rat vector& v1 , const rat vector& v2 )<br />

3.2 Tests<br />

bool v == const rat vector& w Test for equality.<br />

bool v != const rat vector& w Test for inequality.<br />

3.3 Arithmetical Operators<br />

returns the cross product of the threedimensional<br />

vectors v1 and v2 .<br />

rat vector<br />

rat vector<br />

integer n ∗ const rat vector& v<br />

multiplies all cartesian coordinates by n.<br />

rational r ∗ const rat vector& v<br />

multiplies all cartesian coordinates by r.<br />

rat vector& v ∗= integer n multiplies all cartesian coordinates by n.<br />

rat vector& v ∗= rational r multiplies all cartesian coordinates by r.<br />

rat vector<br />

rat vector<br />

const rat vector& v / integer n<br />

divides all cartesian coordinates by n.<br />

const rat vector& v / rational r<br />

divides all cartesian coordinates by r.<br />

rat vector& v /= integer n divides all cartesian coordinates by n.<br />

rat vector& v /= rational r divides all cartesian coordinates by r.<br />

rational<br />

rat vector<br />

const v ∗ const rat vector& w<br />

const rat vector& v + const rat vector& w<br />

scalar product, i.e., ∑ 0≤i

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

Saved successfully!

Ooh no, something went wrong!