Sampling uniformly distributed random points inside a spherical volume

前端 未结 9 672
无人及你
无人及你 2020-11-27 13:10

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

9条回答
  •  青春惊慌失措
    2020-11-27 13:27

    Generate a set of points uniformly distributed within a cube, then discard the ones whose distance from the center exceeds the radius of the desired sphere.

提交回复
热议问题