Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know the basic idea is to generate a random number from $U(0,1)$, find the inverse cumulative distribution function $F^{-1}$ and then take $x = F^{-1}(U)$. If you were plot a histogram of say 1000 samples, the distribution would be $F$. Is there any standard technique to do point picking of a particular shape using this technique. Meaning, can you generate points uniformly inside a distribution using this technique or can you only generate a distribution of observations? The only other generalizable techniques I know of to generate points is rejection sampling.

share|cite|improve this question

Yes you can uniformly pick points from an arbitrary polygon without using rejection sampling. First triangulate your polygon. Then randomly pick one of the triangles. After this, randomly choose a point inside the triangle using this. Repeat this process.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.