title: Generate a random point within a circle (uniformly)
body: <p>I need to generate a uniformly random point within a circle of radius <em>R</em>.</p>
  
  <p>I realize that by just picking a uniformly random angle in the interval [0 ... 2π), and uniformly random radius in the interval (0 ... <em>R</em>) I would end up with more points towards the center, since for two given radii, the points in the smaller radius will be closer to each other than for the points in the larger radius.</p>
  
  <p>I found a blog entry on this <a href="http://www.anderswallin.net/2009/05/uniform-random-points-in-a-circle-using-polar-coordinates/" rel="noreferrer">over here</a> but I don't understand his reasoning. I suppose it is correct, but <strong>I would really like to understand from where he gets (2/<em>R</em><sup>2</sup>)&times;<em>r</em> and how he derives the final solution.</strong></p>
  
  <hr>
  
  <p><strong>Update:</strong> 7 years after posting this question I still hadn't received a satisfactory answer on the actual question regarding the math behind the square root algorithm. So I spent a day writing an answer myself. <a href="https://stackoverflow.com/a/50746409/276052">Link to my answer</a>.</p>