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.

vector v.rotate90(int i = 1) returns v by an angle of i × 90 degrees. If i ><br />

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

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

vector v.rotate(double a) returns the v rotated counterclockwise by an angle<br />

of a (in radian).<br />

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

vector& v += const vector& v1 Addition and assign.<br />

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

vector& v −= const vector& v1 Subtraction and assign.<br />

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

vector v + const vector& v1 Addition.<br />

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

vector v − const vector& v1 Subtraction.<br />

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

double v ∗ const vector& v1 Scalar multiplication.<br />

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

vector v ∗ double r Componentwise multiplication with double r.<br />

vector v / double r Componentwise division which double r.<br />

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

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

void v.print(ostream& O) prints v componentwise to ostream O.<br />

void v.print( ) prints v to cout.<br />

void v.read(istream& I) reads d = v.dim( ) numbers from input stream I<br />

and writes them into v[0] . . . v[d − 1].<br />

void v.read( ) reads v from cin.<br />

ostream&<br />

ostream& O ≪ const vector& v<br />

writes v componentwise to the output stream O.<br />

istream& istream& I ≫ vector& v reads v componentwise from the input stream I.<br />

Additional Operations for vectors in two and three-dimensional space<br />

double v.xcoord( ) returns the zero-th cartesian coordinate of v.<br />

double v.ycoord( ) returns the first cartesian coordinate of v.

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

Saved successfully!

Ooh no, something went wrong!