Processing math: 100%

Wednesday, 9 May 2012

Uniformly Distributed Random Points Inside a Circle

So I just started my blog and I already posted my first blog. Now I want to get my hand dirty by posting some math!

The problem I want to consider here is generation of uniformly distributed random points inside different geometric shapes. The simplest shape to consider is a rectangle. In this case, the generation of uniformly distributed random points is trivial. Let l be the length of the square, w be the width, and the point pc(xc,yc) be the center of the rectangle. Let pi(X,Y) be a random point inside the rectangle. Here X and Y are random variables. For pi to be uniformly distributed, X must be a uniform distribution over the interval [lxc2,l+xc2], and Y must be a uniform distribution over the interval [wyc2,w+yc2]. Well this is fairly trivial.

Now lets consider a circle. The problem is not as trivial. We define a circle by its radius rc and the point representing its center pc(xc,yc). For simplicity lets assume the center of the circle is on the origin (i.e. pc(0,0) ). The first guess that people typically give (which is wrong) is to use polar coordinates with r and θ uniformly distributed over [0,rc] and [0,2π], respectively. The reason this turn out to be wrong is because the area of a circle with radius rc2 and the area of a ring (or doughnut) with width rc2 are not the same. What is the correct answer? (I will post the answer with derivation in a few days!)

See the answer here.

No comments:

Post a Comment