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.

14.6 Polygons ( POLYGON )<br />

1. Definition<br />

<strong>The</strong>re are three instantiations of POLYGON : polygon (floating point kernel), rat polygon<br />

(rational kernel) and real polygon (real kernel). <strong>The</strong> respective header file name corresponds<br />

to the type name (with “.h” appended).<br />

An instance P of the data type POLYGON is a cyclic list of points (equivalently segments)<br />

in the plane. A polygon is called simple if all nodes of the graph induced by its segments<br />

have degree two and it is called weakly simple, if its segments are disjoint except for<br />

common endpoints and if the chain does not cross itself. See the <strong>LEDA</strong> book for more<br />

details.<br />

A weakly simple polygon splits the plane into an unbounded region and one or more<br />

bounded regions. For a simple polygon there is just one bounded region. When a weakly<br />

simple polygon P is traversed either the bounded region is consistently to the left of P or<br />

the unbounded region is consistently to the left of P . We say that P is positively oriented<br />

in the former case and negatively oriented in the latter case. We use P to also denote the<br />

region to the left of P and call this region the positive side of P .<br />

<strong>The</strong> number of vertices is called the size of P . A polygon with empty vertex sequence is<br />

called empty.<br />

Only the types rat polygon and real polygon guarantee correct results. Almost all operations<br />

listed below are available for all the three instantiations of POLYGON . <strong>The</strong>re is<br />

a small number of operations that are only available for polygon, they are indicated as<br />

such.<br />

#include < <strong>LEDA</strong>/geo/generic/POLYGON.h ><br />

2. Types<br />

POLYGON :: coord type<br />

POLYGON :: point type<br />

POLYGON :: float type<br />

the coordinate type (e.g. rational).<br />

the point type (e.g. rat point).<br />

the corresponding floating-point type (polygon).<br />

3. Creation<br />

POLYGON P ; introduces a variable P of type POLYGON . P is initialized<br />

to the empty polygon.

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

Saved successfully!

Ooh no, something went wrong!