u
in the range [0, 1).D
from the origin using the inverse CDF: D = sqrt(u)
.theta
in the range [0, 2*PI).(D, theta)
to Cartesian coordinates to get the point (x, y)
:
x = D * cos(theta)
y = D * sin(theta)
(x, y)
by the circle's center (x_center, y_center)
:
x += x_center
y += y_center
(x, y)
as the random point inside the circle.