title: Points uniformly distributed on unit disk (2D)
body: <p>I am trying to generate 10,000 points from the uniform distribution on the unit disk and plot these points.</p>
  
  <p>The method I am using has three steps. The first step is generating the magnitude of the point x. This point has cdf F(x) = x^2 min(x) = 0 and max(x) = 1. The second step involves generating a 2 dimensional vector (which I will call y) from the multivariate normal distribution with mu being the zero vector and sigma being the 2x2 identity matrix - MVN(0,I). Last I normalize the vector y to have length x. I have tried to code the solution in R but I do not think my answer is correct. I would really appreciate if I could be pointed in the right direction.</p>
  
  <pre><code>u = runif(10000)
  x = u^2
  y = mvrnorm(10000, mu=rep(0,2), Sigma=diag(2))
  y_norm = (x*y)/sqrt(sum(y^2))
  plot(y_norm, asp = 1)
  </code></pre>
  
  <p>I used the MASS package for mvrnorm. Also I have included the plot that I ended up with:<a href="https://i.stack.imgur.com/tzL1q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tzL1q.png" alt="enter image description here"></a></p>