~mht/cra

ref: a3f4797faa2ae9132d5c562127285d8c56e01149 cra/cra/generate-points.py -rw-r--r-- 363 bytes
a3f4797f — Martin Hafskjold Thoresen Output all the pdfs 2 years 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 = 800
min_y = 0
max_y = 800

num_points = 10000

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()))