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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

line l.translate(const vector& v)<br />

returns l translated by vector v.<br />

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

line l + const vector& v returns l translated by vector v.<br />

line l − const vector& v returns l translated by vector −v.<br />

line l.rotate(const point& q, double a)<br />

returns l rotated about point q by angle a.<br />

line l.rotate(double a) returns l.rotate(point(0, 0), a).<br />

line l.rotate90(const point& q, int i = 1)<br />

line l.reflect(const point& p, const point& q)<br />

line l.reverse( ) returns l reversed.<br />

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

returns l rotated about q by an angle of i × 90<br />

degrees. If i > 0 the rotation is counter-clockwise<br />

otherwise it is clockwise.<br />

returns l reflected across the straight line passing<br />

through p and q.<br />

returns the segment perpendicular to l with source<br />

p. and target on l.<br />

point l.dual( ) returns the point dual to l.<br />

Precondition: l is not vertical.<br />

int l.side of(const point& p) computes orientation(a, b, p), where a ≠ b and a<br />

and b appear in this order on line l.<br />

bool l.contains(const point& p) returns true if p lies on l.<br />

bool l.clip(point p, point q, segment& s)<br />

Non-Member Functions<br />

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

clips l at the rectangle R defined by p and q. Returns<br />

true if the intersection of R and l is nonempty<br />

and returns false otherwise. If the intersection<br />

is non-empty the intersection is assigned to<br />

s; It is guaranteed that the source node of s is no<br />

larger than its target node.<br />

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

and b appear in this order on line l.

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

Saved successfully!

Ooh no, something went wrong!