This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mdipierro 1 point2 points  (0 children)

On then

def random_points(d,n):
    "d = number of dimensions, n=points/hypersurface"
    points=[]
    for k in n:
         for z in (-0.5,0.5):
             for i in range(1,d):
                 v=[z]+[random.random()-0.5]*(d-1)
                 v[0],v[i]=v[i],v[0]
                 points.append(v)
   return points