A toolset for generate random points and map it.
we will move to 'data' directory to start all examples, this directory have been added to '.gitignoe' , so is convenient to test in local and light in cloud
import matplotlib.pyplot as plt
cd data
rand_point_x = []
rand_point_y = []
rand_point_x, rand_point_y = random_generate(offset_x = -143,
offset_y = 184,
point_num = 100,
area_length_x = 200,
area_length_y = 50)
plot the lines and points that just generate.
draw_line(sub_area_num = 20,
x_min = -233,
x_increment = 10,
y_min = 160,
y_max = 210)
plt.plot(rand_point_x, rand_point_y, 'o', color='red')
generate sub random points and save it in rand_point_x, rand_point_y.
rand_point_x = []
rand_point_y = []
rand_point_x, rand_point_y = sub_random_generate(offset_x = -143,
offset_y = 184,
point_num = 100,
area_length_x = 200,
area_length_y = 50,
sub_area_num = 20,
sub_offset_x = 10,
sub_offset_y = 10)
plot the lines and points that just generate.
draw_line(20, -233, 10, 160, 210)
plt.plot(rand_point_x, rand_point_y, 'o', color='red')