homogen

homogen
import random
import matplotlib.pyplot as plt

def points(N, r):
c = 0
while c < N:
x = random.random()
y = random.random()
if x**2 + y**2 <= r**2:
c += 1
yield x, y

x, y = zip(*points(10000, 1))

plt.scatter(x, y)
plt.show()
reox
Beiträge: 2463
Registriert: 06.06.2006 22:09:47

homogen


05.01.2019 11:51:32
337

Zurück zu „Bilder vom Forum“