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.22 Real Triangles ( real triangle )<br />

1. Definition<br />

An instance t of the data type real triangle is an oriented triangle in the two-dimensional<br />

plane. A triangle splits the plane into one bounded and one unbounded region. If the<br />

triangle is positively oriented, the bounded region is to the left of it, if it is negatively<br />

oriented, the unbounded region is to the left of it. A triangle t is called degenerate, if the<br />

3 vertices of t are collinear.<br />

#include < <strong>LEDA</strong>/geo/real triangle.h ><br />

2. Types<br />

real triangle :: coord type<br />

real triangle :: point type<br />

the coordinate type (real).<br />

the point type (real point).<br />

3. Creation<br />

real triangle t;<br />

introduces a variable t of type real triangle. t is initialized to<br />

the empty triangle.<br />

real triangle t(const real point& p, const real point& q, const real point& r);<br />

introduces a variable t of type real triangle. t is initialized to<br />

the triangle [p, q, r].<br />

real triangle t(real x1 , real y1 , real x2 , real y2 , real x3 , real y3 );<br />

real triangle t(const triangle& t1 , int prec = 0);<br />

real triangle t(const rat triangle& t1 );<br />

introduces a variable t of type real triangle. t is initialized to<br />

the triangle [(x1, y1), (x2, y2), (x3, y3)].<br />

introduces a variable t of type real triangle initialized to the<br />

triangle t 1 . (<strong>The</strong> second argument is for compatibility with<br />

rat triangle.)<br />

introduces a variable t of type real triangle initialized to the<br />

triangle t 1 .<br />

4. Operations<br />

real point t.point1( ) returns the first vertex of triangle t.<br />

real point t.point2( ) returns the second vertex of triangle t.

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

Saved successfully!

Ooh no, something went wrong!