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.

at segment s.rotate90(int i = 1)<br />

returns s rotated about the origin by an angle of i × 90<br />

degrees.<br />

rat segment s.reflect(const rat point& p, const rat point& q)<br />

rat segment s.reflect(const rat point& p)<br />

returns s reflected across the straight line passing through<br />

p and q.<br />

returns s reflected across point p.<br />

rat segment s.reverse( )<br />

returns s reversed.<br />

rat segment s.perpendicular(const rat point& p)<br />

returns the segment perpendicular to s with source p and<br />

target on line(s).<br />

Precondition: s is nontrivial.<br />

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

rational s.sqr dist(const rat point& p)<br />

returns the squared Euclidean distance between p and s.<br />

rational s.sqr dist( ) returns the squared distance between s and the origin.<br />

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

bool<br />

s == const rat segment& t<br />

returns true if s and t are equal as oriented segments<br />

int equal as sets(const rat segment& s, const rat segment& t)<br />

Non-Member Functions<br />

returns true if s and t are equal as unoriented segments<br />

int cmp slopes(const rat segment& s1 , const rat segment& s2 )<br />

returns compare(slope(s 1 ), slope(s 2 )).<br />

int cmp segments at xcoord(const rat segment& s1 , const rat segment& s2 ,<br />

const rat point& p)<br />

compares points l 1 ∩ v and l 2 ∩ v where l i is the line underlying<br />

segment s i and v is the vertical straight line passing<br />

through point p.<br />

int orientation(const rat segment& s, const rat point& p)<br />

computes orientation(a, b, p), where a ≠ b and a and b<br />

appear in this order on segment s.

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

Saved successfully!

Ooh no, something went wrong!