<i>> I found this neat technique, to find random points in a circle where a random radius r and angle theta are chosen and the x,y points are obtained as x = centerX + r * cos(theta) and y = centerY + r * sin(theta)</i><p>This misses the crucial point of the technique described in the linked Stackoverflow answer: that <i>r</i> cannot be a uniformly distributed random value if you want a uniform distribution of points in a circle. Rather you need<p><pre><code> r = R * sqrt(random())
</code></pre>
where R is the radius of the circle and random() gives a uniform distribution of random numbers between 0 and 1.