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.

ool s.intersection(const real segment& t, real point& p)<br />

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

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

bool s.intersection of lines(const real segment& t, real point& p)<br />

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

real segment s.translate(const real vector& v)<br />

real segment s + const real vector& v<br />

real segment s − const real vector& v<br />

if line(s) and line(t) intersect in a single point this point<br />

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

is false.<br />

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

returns s + v, i.e., s translated by vector v.<br />

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

returns s translated by vector v.<br />

returns s translated by vector −v.<br />

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

real s.distance(const real point& p)<br />

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

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

target on line(s).<br />

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

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

real s.distance( ) returns the Euclidean distance between (0, 0) and s.<br />

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

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

returns s rotated about q by an angle of i × 90 degrees.<br />

If i > 0 the rotation is counter-clockwise otherwise it is<br />

clockwise.<br />

returns s.rotate90(s.source(),i).<br />

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

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

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

p and q.<br />

returns s reflected across point p.

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

Saved successfully!

Ooh no, something went wrong!