[SciPy-User] random points within an ellipse

Benjamin Root ben.root@ou....
Thu Aug 5 20:58:29 CDT 2010

On Thu, Aug 5, 2010 at 4:16 PM, nicky van foreest <vanforeest@gmail.com>wrote:

> Hi,
> I actually wonder whether this is the type of distribution you want to
> see. Lets apply the method described below to a circle (that is just a
> special type of ellipse) with unit radius and center at (0,0). With p
> =1/2 you will hit the segments of the circle  at the left of the line
> such that x=-1/2 or at the right of the line with x =1/2. However the
> segments above the line with y=1/2 or below the line with y = -1/2
> will be hit with a smaller probability. Thus, the distribution of
> points on the circle produced by the method below is certainly not
> rotationally invariant.
> I recall having read three ways to produce a random point in a circle,
> but I forgot where (perhaps it can be found in Feller, or the book by
> Jaynes), and each of the three methods gives different distributions
> with different properties.
> Nicky
Running the code for just a regular circle (and shrinking the size of the
markers), I can not see any visual evidence of biases within the ellipse.
Maybe it, mathematically, has a slight bias one way or another, but I think
Ian's approach to be sufficient for my purposes.

Ben Root
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20100805/f1b47360/attachment.html 

More information about the SciPy-User mailing list