     Next: Point on Rational Circle Up: Basic Data Types for Previous: Transformation ( TRANSFORM )   Contents   Index

# Point Generators ( point generators )

All generators are available for point, rat_point, real_point, d3_point, and d3_rat_point. We use POINT to stand for any of these classes. The corresponding header files are called random_point.h, random_rat_point.h, random_real_point.h, random_d3_point.h, and random_d3_rat_point.h, respectively. These header files are included in the corresponding kernel header files, e.g., random_rat_point.h is part of rat_kernel.h.

We use the following naming conventions: square, circle, segment, and disk refer to two-dimensional objects (even in 3d) and cube, ball, and sphere refer to full-dimensional objects, i.e, in 2d cube and square, ball and disk, and circle and sphere are synonymous.

 void random_point_in_square(POINT& p, int maxc) returns a point whose x and y-coordinates are random integers in [- maxc..maxc]. The z-coordinate is zero. void random_points_in_square(int n, int maxc, list& L) returns a list L of n points ... . void random_point_in_unit_square(POINT& p, int D = (1«30) - 1) returns a point whose coordinates are random rationals of the form i/D where i is a random integer in the range [0..D]. The default value of D is 230 - 1. void random_points_in_unit_square(int n, int D, list& L) returns a list L of n points ... . void random_points_in_unit_square(int n, list& L) returns a list L of n points ... . The default value of D is used. void random_point_in_cube(POINT& p, int maxc) returns a point whose coordinates are random integers in [- maxc..maxc]. In 2d this function is equivalent to random_point_in_square. void random_points_in_cube(int n, int maxc, list& L) returns a list L of n points ... . void random_point_in_unit_cube(POINT& p, int D = (1«30) - 1) returns a point whose coordinates are random rationals of the form i/D where i is a random integer in the range [0..D]. The default value of D is 230 - 1. void random_points_in_unit_cube(int n, int D, list& L) returns a list L of n points ... . void random_points_in_unit_cube(int n, list& L) as above, but the default value of D is used. void random_point_in_disc(POINT& p, int R) returns a random point with integer x and y-coordinates in the disc with radius R centered at the origin. The z-coordinate is zero. Precondition R < = 230. void random_points_in_disc(int n, int R, list& L) returns a list L of n points ... . void random_point_in_unit_disc(POINT& p, int D = (1«30) - 1) returns a point in the unit disc whose coordinates are quotients with denominator D. The default value of D is 230 - 1. void random_points_in_unit_disc(int n, int D, list& L) returns a list L of n points ... . void random_points_in_unit_disc(int n, list& L) returns a list L of n points ... . The default value of D is used. void random_point_in_ball(POINT& p, int R) returns a random point with integer coordinates in the ball with radius R centered at the origin. In 2d this function is equivalent to random_point_in_disc. Precondition R < = 230. void random_points_in_ball(int n, int R, list& L) returns a list L of n points ... . void random_point_in_unit_ball(POINT& p, int D = (1«30) - 1) returns a point in the unit ball whose coordinates are quotients with denominator D. The default value of D is 230 - 1. void random_points_in_unit_ball(int n, int D, list& L) returns a list L of n points ... . void random_points_in_unit_ball(int n, list& L) returns a list L of n points ... . The default value of D is used. void random_point_near_circle(POINT& p, int R) returns a random point with integer coordinates that lies close to the circle with radius R centered at the origin. void random_points_near_circle(int n, int R, list& L) returns a list L of n points ... . void random_point_near_unit_circle(POINT& p, int D = (1«30) - 1) returns a point close to the unit circle whose coordinates are quotients with denominator D. The default value of D is 230 - 1. void random_points_near_unit_circle(int n, int D, list& L) returns a list L of n points ... . void random_points_near_unit_circle(int n, list& L) returns a list L of n points ... . The default value of D is used. void random_point_near_sphere(POINT& p, int R) returns a point with integer coordinates close to the sphere with radius R centered at the origin. void random_points_near_sphere(int n, int R, list& L) returns a list L of n points ... . void random_point_near_unit_sphere(POINT& p, int D = (1«30) - 1) returns a point close to the unit sphere whose coordinates are quotients with denominator D. In 2d this function is equivalent to point_near_unit_circle. void random_points_near_unit_sphere(int n, int D, list& L) returns a list L of n points ... . void random_points_near_unit_sphere(int n, list& L) returns a list L of n points ... . The default value of D is used.

Wit the rational kernel the functions _on_circle are guaranteed to produce points that lie precisely on the specified circle. With the floating point kernel the functions are equivalent to the _near_circle functions.

 void random_point_on_circle(POINT& p, int R, int C = 1000000) returns a random point with integer coordinates that lies on the circle with radius R centered at the origin. The point is chosen from a set of at least C candidates. void random_points_on_circle(int n, int R, list& L, int C = 1000000) returns a list L of n points ... . void random_point_on_unit_circle(POINT& p, int C = 1000000) returns a point on the unit circle. The point is chosen from a set of at least C candidates. void random_points_on_unit_circle(int n, list& L, int C = 1000000) returns a list L of n points ... . void random_point_on_sphere(POINT& p, int R) same as random_point_near_sphere. void random_points_on_sphere(int n, int R, list& L) returns a list L of n points ... . void random_point_on_unit_sphere(POINT& p, int D = (1«30) - 1) same as random_point_near_unit_sphere. void random_points_on_unit_sphere(int n, int D, list& L) returns a list L of n points ... . void random_points_on_unit_sphere(int n, list& L) returns a list L of n points ... . The default value of D is used. void random_point_on_segment(POINT& p, SEGMENT s) generates a random point on s. void random_points_on_segment(SEGMENT s, int n, list& L) generates a list L of n points ... . void points_on_segment(SEGMENT s, int n, list& L) generates a list L of n equally spaced points on s. void random_point_on_paraboloid(POINT& p, int maxc) returns a point (x, y, z) with x and y random integers in the range [- maxc..maxc], and z = 0.004*(x*x + y*y) - 1.25*maxc. The function does not make sense in 2d. void random_points_on_paraboloid(int n, int maxc, list& L) returns a list L of n points ... . void lattice_points(int n, int maxc, list& L) returns a list L of approximately n points. The points have integer coordinates id /maxc for an appropriately chosen d and - maxc/d < = i < = maxc/d. void random_points_on_diagonal(int n, int maxc, list& L) generates n points on the diagonal whose coordinates are random integer in the range from - maxc to maxc.     Next: Point on Rational Circle Up: Basic Data Types for Previous: Transformation ( TRANSFORM )   Contents   Index