~mht/cra

ref: 0ae09d4ccc2fc00e0591c85d8885f2cc724679be cra/cra/generate-points.py -rw-r--r-- 370 bytes
0ae09d4c — Martin Hafskjold Thoresen Fix plot bug, and improve stats printing 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 = 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()))