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

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

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

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

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

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

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

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

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

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

Precondition: s is not vertical.<br />

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

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

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

double s.direction( ) returns the direction of s as an angle in the intervall [0, 2π).<br />

double s.angle( ) returns s.direction().<br />

double s.angle(const segment& t)<br />

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

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

returns the angle between s and t, i.e., t.direction() -<br />

s.direction().<br />

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

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

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

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

Precondition: s is not horizontal.<br />

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

Precondition: s is not vertical.<br />

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

Precondition: s is not vertical.

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

Saved successfully!

Ooh no, something went wrong!