[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
![]() |
Polygon< POINT > Class Template Reference | ![]() |
#include <vigra/polygon.hxx>
Public Member Functions | |
double | arcLengthQuantile (double quantile) const |
bool | closed () const |
Returns true iff the last and first points are equal or the polygon is empty. | |
bool | contains (const_reference point, coordinate_type tolerance) const |
Point | interpolate (unsigned int index, double offset) const |
Polygons in two and higher dimenions.
Point interpolate | ( | unsigned int | index, |
double | offset | ||
) | const |
Linearly interpolate at offset
between knots index
and index+1
.
Preconditions: 0 <= index < size()-1
and 0 <= offset <= 1
.
bool contains | ( | const_reference | point, |
coordinate_type | tolerance | ||
) | const |
Tests whether the given point lies within this polygon. Requires that this polygon is closed.
Points which lie directly on the polylines or coincide with a knot are considered inside (this behavior is consistent with fillPolygon()). Parameter tolerance (interpreted as an absolute error bound) controls the numerical accuracy of this test.
double arcLengthQuantile | ( | double | quantile | ) | const |
Find the point on the polygon that corresponds to the given quantile.
quantile must be in [0.0, 1.0]
. The result of this function can be used as input to interpolate()
. For example, the following code computes the point in the middle of the polygon:
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |