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.

eal vector v.norm( )<br />

returns v normalized.<br />

real 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 />

real vector v + const real vector& v1<br />

real vector v − const real vector& v1<br />

Addition.<br />

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

Subtraction.<br />

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

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

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

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

bool<br />

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

bool v != const real 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 />

istream&<br />

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

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

istream& I ≫ real vector& v<br />

reads v componentwise from the input stream I.<br />

vector v.to float( ) returns a floating point approximation of v.<br />

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

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

real v.ycoord( ) returns the first cartesian coordinate of v.<br />

real v.zcoord( ) returns the second cartesian coordinate of v.

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

Saved successfully!

Ooh no, something went wrong!