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.

double l.direction( ) returns the direction of l.<br />

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

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

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

double l.sqr dist(const point& q) returns the square of the distance between l and<br />

q.<br />

double l.distance(const point& q) returns the distance between l and q.<br />

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

returns orientation(l.point1(), l.point2(), p).<br />

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

Precondition: l is not vertical.<br />

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

x.<br />

Precondition: l is not vertical.<br />

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

y.<br />

Precondition: l is not horizontal.<br />

double l.y abs( ) returns the y-abscissa of l (l.y proj(0)).<br />

Precondition: l is not vertical.<br />

bool l.intersection(const line& g, point& p)<br />

if l and g intersect in a single point this point is<br />

assigned to p and the result is true, otherwise the<br />

result is false.<br />

bool<br />

l.intersection(const segment& s, point& inter)<br />

if l and s intersect in a single point this point is<br />

assigned to p and the result is true, otherwise the<br />

result is false.<br />

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

returns true, if l and s intersect, false otherwise.<br />

line l.translate by angle(double a, double d)<br />

returns l translated in direction a by distance d.<br />

line<br />

l.translate(double dx, double dy)<br />

returns l translated by vector (dx, dy).

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

Saved successfully!

Ooh no, something went wrong!