I would like to create a random data sample to test a clustering algorithm using python. One specific data sample I would like to generate consists of two non-overlapping annuluses (annuli?); however, it's okay if the inner-most annuli is a circle - as in the image below (taken from this question).
I realize that I can sample N
values of angles ti
such that 0 ≤ ti ≤ 2 pi
. Based on some reading online, I think one can generate N
samples of circular data by specifying a fixed radius r
such that xi = r cos(ti)
and yi = r sin(ti)
. Applying this reasoning to the desired annulus, I am thinking one can repeat the process for variable radii rmin
and rmax
; however, I am not sure how to proceed from this point. My thinking is to generate n
samples of radii ri
(where n
< N
, the annulus cluster is a subset of all the data) such that rmin ≤ ri ≤ rmax
; doing so necessarily means the first cluster should be the n
points within the the outer-most annulus and the second cluster should be the N-n
points within the inner-most annulus/circle.
So my questions are as follows:
1) Is my approach so far reasonable? Are there (dis)advantages to this approach, such as clustering more near centers or borders?
2) If my approach is wrong, why is it wrong and what would be a better approach?
EDIT:
The original post that serves as a potential duplicate actually shows how to sample points within a circle, not an annulus. I am concerned with the case of an annulus.
rho
is generated, you get the annulus. $\endgroup$rmin
andrmax
the proper way to "constrain the part whererho
is generated"? $\endgroup$