top of page
# gen_points.py
# Creating a Ring Structure
import random
import math
def ring(num, innerR, outerR):
data = []
n = 0
while n < num:
x = random.uniform(-outerR, outerR)
y = 0
z = random.uniform(-outerR, outerR)
dist = math.sqrt(x * x + z * z)
if dist >= innerR and dist <= outerR:
data.append( (x,y,z) )
n = n + 1
return data
}
bottom of page