MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: random points!


Hi,

I think that this is the simplest solution:

dimitris wrote:
> How can I add as much points as possible inside the half-circle
> (so that there are not so big white regions as in the previous
> drawing)

In[22]:=
pts = Table[{Random[Real,{-1,1}], Random[Real,{-1,1}]}, {10000}];

> assuring that they are not situated outside it?

In[23]:=
pts = Cases[pts, {x_,y_} /; Sqrt[x^2+y^2] < 1 && y < 0];

In[24]:=
Graphics[Point/@pts, AspectRatio -> Automatic] // Show

Szabolcs



  • Prev by Date: Re: Slow Show/Graphics in v6.0
  • Next by Date: Re: random points!
  • Previous by thread: Re: random points!
  • Next by thread: Re: random points!