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.

eal point r.point2( ) returns a point on r different from r.source( ).<br />

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

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

real r.slope( ) returns the slope of the straight line underlying r.<br />

Precondition: r is not vertical.<br />

bool<br />

bool<br />

real ray<br />

r.intersection(const real ray& s, real point& inter)<br />

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

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

the result is false.<br />

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

r.translate(real dx, real dy)<br />

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

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

the result is false.<br />

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

real ray r.translate(const real vector& v)<br />

returns r translated by vector v<br />

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

real ray r + const real vector& v returns r translated by vector v.<br />

real ray r − const real vector& v returns r translated by vector −v.<br />

real ray r.rotate90(const real point& q, int i = 1)<br />

real ray r.reflect(const real point& p, const real point& q)<br />

real ray r.reflect(const real point& p)<br />

returns r 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 r reflected across the straight line passing<br />

through p and q.<br />

returns r reflected across point p.<br />

real ray r.reverse( ) returns r reversed.<br />

bool r.contains(const real point& )<br />

bool r.contains(const real segment& )<br />

decides whether r contains p.<br />

decides whether r contains s.

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

Saved successfully!

Ooh no, something went wrong!