public class PolygonSampler extends Object
Constructor and Description |
---|
PolygonSampler() |
Modifier and Type | Method and Description |
---|---|
protected Point2D |
interpolate(Point2D p0,
Point2D p1,
double alpha) |
protected double |
pathLength(Point2D[] V) |
Point2D[] |
samplePolygonUniformly(Point2D[] V,
int M)
Samples the closed polygon path specified by V at M
equi-distant positions.
|
Point2D[] |
samplePolygonUniformly(Point2D[] V,
int M,
double startFrac)
This is for testing: allows to choose an arbitrary start point by
setting 'startFrac' in [0,1].
|
public PolygonSampler()
public Point2D[] samplePolygonUniformly(Point2D[] V, int M)
V
- the vertices of the (closed) polygon.M
- the number of sample points.public Point2D[] samplePolygonUniformly(Point2D[] V, int M, double startFrac)
V
- the vertices of the (closed) polygon.M
- the number of sample points.startFrac
- the position of the first sample as a fraction of the
polggon's circumference in [0,1].protected double pathLength(Point2D[] V)
protected Point2D interpolate(Point2D p0, Point2D p1, double alpha)
Copyright © 2006–2017, Wilhelm Burger, Mark J. Burge (BSD 2-Clause Simplified License)