From: brabuhr@... Date: 2010-06-23T03:09:53+09:00 Subject: Re: [QUIZ] Random Points within a Circle (#234) 2010/6/22 Benoit Daloze : > On 22 June 2010 01:12, Dave Howell wrote: >> On Jun 21, 2010, at 15:45 , Caleb Clausen wrote: >>> On 6/19/10, Daniel Moore wrote: >>>> The quiz this week >>>> is to generate random points uniformly distributed within a circle of >>>> a given radius and position. > > Caleb: >> I guess this is why Benoit had that sqrt in there. I don't quite get >> why it's necessary. > > The image would then look like a point in the center. > I 'felt' it would result in that because the points near the center > will be much closer to each other, as it will be as much points at any > distance. > > And finally, why the sqrt? I just felt like I should have as many > points in each area, and the area of a circle is ğr^2, so let's reduce > this r^2 and becomes r. (Also I wanted the random distance to be > likely further from the center, and as rand returns between 0 and 1, > we have to do ^(1/2) and not ^2. Found an explanation: http://www.anderswallin.net/2009/05/uniform-random-points-in-a-circle-using-polar-coordinates/