-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpoint_cloud.py
45 lines (40 loc) · 939 Bytes
/
point_cloud.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
# uniform
x = np.random.uniform(-10000,10000,1000)
y = np.random.uniform(-10000,10000,1000)
plt.scatter(x,y,s=10)
plt.show()
# normal
x = np.random.normal(0,3000,1000)
y = np.random.normal(0,3000,1000)
plt.scatter(x,y,s=10)
plt.show()
# circular uniform
radius = 10000
a = np.random.uniform(0,1,1000) * 2 * math.pi
r = radius * np.sqrt(np.random.uniform(0,1,1000))
x = r * np.cos(a)
y = r * np.sin(a)
plt.scatter(x,y,s=10)
plt.show()
# circular
radius = 10000
jitter = 1000
a = np.random.uniform(0,1,1000) * 2 * math.pi
r = np.random.normal(radius,jitter,1000)
x = r * np.cos(a)
y = r * np.sin(a)
plt.scatter(x,y,s=10)
plt.show()
# radiating lines
radius = 10000
num_lines = 6
a = np.random.randint(num_lines,size=1000) / num_lines * 2 * math.pi
r = np.random.uniform(0,radius,1000)
x = r * np.cos(a)
y = r * np.sin(a)
plt.scatter(x,y,s=10)
plt.show()