~mht/cra

ref: bae1de7fcfbd2d5878884b2271f21df3fee32fea cra/generate-points.py -rw-r--r-- 370 bytes
bae1de7f — Martin Hafskjold Thoresen Remove _by_dim suffix. 1 year, 3 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Generate random points in some range

from random import seed, random

min_x = 0
max_x = 10000
min_y = 0
max_y = 10000

num_points = int(1e6)

seed(0)

def x():
    x_range = max_x - min_x
    return random() * x_range + min_x

def y():
    y_range = max_y - min_y
    return random() * y_range + min_y

for _ in range(num_points):
    print('{} {}'.format(x(), y()))