Algorithmic Solutions > LEDA > LEDA Guide > Geometry > Generators for Geometric Objects
Generators for Geometric ObjectsThere is a frequent need to generate geometric objects, random or otherwise.
Generators for Random Points
There are generators for random points in squares, in discs, near circles, and on circles. For each generator there is a version that generates a single point and a version that generates a list of points. See the Manual Page Point Generators for details.
All generators are available for
Generating PolygonsThere are three generators for polygons.
POLYGON reg_n_gon(int n,CIRCLE C, double epsilon); POLYGON n_gon(int n, CIRCLE C, double epsilon); POLYGON hilbert(int n, RAT_TYPE x1, RAT_TYPE y1, RAT_TYPE x2, RAT_TYPE y2);
The first generates a regular n-gon. With the rational kernel the vertices
of the n-gon are guaranteed to lie on the circle, with the floating point
kernel they are only guaranteed to lie near
We use the notation