Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

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



  • 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!