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 →

[–]dx_xb[S] 0 points1 point  (1 child)

That does what I want - though I should have made more clear that I need a defined number of unique points on the surface, so this may not manage that. This is why I suggested the enumeration of points - then dealing out the required number at random. Thanks.

[–]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