TOPICS
Search

Disk Point Picking


CircularDistribution

To generate random points over the unit disk, it is incorrect to use two uniformly distributed variables r in [0,1] and theta in [0,2pi) and then take

x = rcostheta
(1)
y = rsintheta.
(2)

Because the area element is given by

dA=2pirdr,
(3)

this gives a concentration of points in the center (left figure above).

The correct transformation is instead given by

x = sqrt(r)costheta
(4)
y = sqrt(r)sintheta
(5)

(right figure above).

The probability function for distance d from the center of a point picked at random in a unit disk is

P(d)=2d.
(6)

The raw moments are therefore given by

giving a mean distance of d^_=2/3.


AltStyle によって変換されたページ (->オリジナル) /