Re: random points!
- To: mathgroup at smc.vnet.net
- Subject: [mg80938] Re: random points!
- From: Szabolcs <szhorvat at gmail.com>
- Date: Thu, 6 Sep 2007 05:19:46 -0400 (EDT)
- Organization: University of Bergen
- References: <fblj4r$p97$1@smc.vnet.net>
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