How to uniformly spread points in circle shaped form

simple solution

you can simply iterate through all map's pixels, and for each pixel inside of the given circle - create unit with probability P``, so the code is something like

for x=1 to max_x
  for y=1 to max_y
    if (x-circle_x)^2 + (y-circle_y)^2 <= circle_r^2
      if random() < P
        map[x][y] = new unit()     

Obviously it is not optimal, as you do not really need iteration through non-circle points, but this should give you the general idea. It is easy to prove, that it generates the uniform distribution, as it is simply generation of the uniform distribution on the whole map and "removing" units from outside of the circle.

more mathematical solution

You can also do it in more strict way, by applying iteratively the uniformly distributed points generator:

for i in 1...numer_of_units_to_generate:
  t = 2*pi*random()
  u = random()+random()
  if u>1 then 
    r=2-u 
  else 
    r=u
  map[r*cos(t)][r*sin(t)]=new unit()

result:

uniformly distributed points on the circle