Can somebody give hint or create random distribution& radius of circles?? but there are several types of circles that have specific range

1 view (last 30 days)
Hello ,
I want more than two types of circles in 1 x 1 printed in rectangle graph.
for example, circle 1: minRadius= 0.07, maxRadius= 0.08, with finite number such as 10
circle 2: minRadius2= 0.1, maxRadius2=0.2, numberofcircles= 20
with non overlapping, and random radius and random distribution satisfying ranges,,
please help me.. I will be very appreciated.
Thank you
  3 Comments
John D'Errico
John D'Errico on 12 Jun 2020
What is the problem? Only you know the desired distribution. It is not meaningful to just state that you want a "random distribution", without specifying the distribution itself anyway.
But just generate randomly placed circles. If they fall inside any other circle, then repeat, until you have enough.
Or start with randomly placed circles or your choosing, ignoring overlaps. Then joggle them around until they are non-overlapping. Good code for this might be to use a repulsive "force", effectively pushing circles that are overlapping, moving them father apart. This could be done iteratively.
But there is no magic formula to generate random non-overlapping circles. Sorry.

Sign in to comment.

Answers (0)

Categories

Find more on Random Number Generation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!