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.

4. Operations<br />

real point s.start( ) returns the source point of segment s.<br />

real point s.end( ) returns the target point of segment s.<br />

real s.xcoord1( ) returns the x-coordinate of s.source().<br />

real s.xcoord2( ) returns the x-coordinate of s.target().<br />

real s.ycoord1( ) returns the y-coordinate of s.source().<br />

real s.ycoord2( ) returns the y-coordinate of s.target().<br />

real s.dx( ) returns the xcoord2 − xcoord1.<br />

real s.dy( ) returns the ycoord2 − ycoord1.<br />

real s.slope( ) returns the slope of s.<br />

Precondition: s is not vertical.<br />

real s.sqr length( ) returns the square of the length of s.<br />

real s.length( ) returns the length of s.<br />

real vector s.to vector( ) returns the vector s.target( ) − s.source( ).<br />

bool s.is trivial( ) returns true if s is trivial.<br />

bool s.is vertical( ) returns true iff s is vertical.<br />

bool s.is horizontal( ) returns true iff s is horizontal.<br />

int s.orientation(const real point& p)<br />

computes orientation(s.source(), s.target(), p) (see below).<br />

real s.x proj(real y) returns p.xcoord(), where p ∈ line(s) with p.ycoord() = y.<br />

Precondition: s is not horizontal.<br />

real s.y proj(real x) returns p.ycoord(), where p ∈ line(s) with p.xcoord() = x.<br />

Precondition: s is not vertical.<br />

real s.y abs( ) returns the y-abscissa of line(s), i.e., s.y proj(0).<br />

Precondition: s is not vertical.<br />

bool s.contains(const real point& p)<br />

decides whether s contains p.<br />

bool s.intersection(const real segment& t)<br />

decides whether s and t intersect in one point.

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

Saved successfully!

Ooh no, something went wrong!