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.

void l.normalize( ) simplifies the homogenous representation<br />

by calling point1 ( ).normalize( ) and<br />

point2 ( ).normlize( ).<br />

rat point l.point1( ) returns a point on l.<br />

rat point l.point2( ) returns a second point on l.<br />

rat segment l.seg( ) returns a segment on l.<br />

bool l.is vertical( ) decides whether l is vertical.<br />

bool l.is horizontal( ) decides whether l is horizontal.<br />

bool<br />

bool<br />

l.intersection(const rat line& g, rat point& inter)<br />

returns true if l and g intersect. In case of intersection<br />

a common point is returned in inter.<br />

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

returns true if l and s intersect. In case of intersection<br />

a common point is returned in inter.<br />

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

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

rat line<br />

rat line<br />

l.translate(const rational& dx, const rational& dy)<br />

returns l translated by vector (dx, dy).<br />

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

returns l translated by vector (dx/dw, dy/dw).<br />

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

returns l translated by vector v.<br />

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

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

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

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

rat line l.reflect(const rat point& p, const rat point& q)<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.

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

Saved successfully!

Ooh no, something went wrong!