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.

14.4 Straight Lines ( line )<br />

1. Definition<br />

An instance l of the data type line is a directed straight line in the two-dimensional plane.<br />

<strong>The</strong> angle between a right oriented horizontal line and l is called the direction of l.<br />

#include < <strong>LEDA</strong>/geo/line.h ><br />

2. Types<br />

line :: coord type<br />

line :: point type<br />

the coordinate type (double).<br />

the point type (point).<br />

3. Creation<br />

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

introduces a variable l of type line. l is initialized to the line<br />

passing through points p and q directed form p to q.<br />

line l(const segment& s); introduces a variable l of type line. l is initialized to the line<br />

supporting segment s.<br />

line l(const ray& r);<br />

introduces a variable l of type line. l is initialized to the line<br />

supporting ray r.<br />

line l(const point& p, const vector& v);<br />

line l(const point& p, double alpha);<br />

introduces a variable l of type line. l is initialized to the line<br />

passing through points p and p + v.<br />

introduces a variable l of type line. l is initialized to the line<br />

passing through point p with direction alpha.<br />

line l;<br />

introduces a variable l of type line. l is initialized to the line<br />

passing through the origin with direction 0.<br />

4. Operations<br />

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

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

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

double l.angle(const line& g) returns the angle between l and g, i.e.,<br />

g.direction() − l.direction().

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

Saved successfully!

Ooh no, something went wrong!