I am looking to be able to generate a random uniform sample of particle locations that fall within a spherical volume.
The image below (courtesy of http://nojhan.fre
Would this be uniform enough for your purposes?
In []: p= 2* rand(3, 1e4)- 1 In []: p= p[:, sum(p* p, 0)** .5<= 1] In []: p.shape Out[]: (3, 5216)
A slice of it
In []: plot(p[0], p[2], '.')
looks like: