Generators for Geometric ObjectsThere is a frequent need to generate geometric objects, random or otherwise.Generators for Random PointsThere 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 Example of Generators for Random Points 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 |
See also:Writing Kernel Independent Code Advanced Data types for 2-D geometry Manual Entries: |