Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Generate randomly spaced circles of different diameters and output overlap

3 ビュー (過去 30 日間)
Karl Yau
Karl Yau 2018 年 6 月 16 日
閉鎖済み: John D'Errico 2018 年 6 月 16 日
So I'm kinda stuck on how to make a script that will output a square box (50x50), with a circle in the centre (d=5), which then has randomly spaced circles plotted of different diameters (0.5,1,2) also random.
The random circles need to make up 30% of the total area (doesn't matter if they overlap). I then need to output the amount of area overlap of random circles with the centre circle, how many circles overlap and what size. This is going to be iterated as a monte carlo simulation.
This is then going to be progressed into a 3D model but with a central cylinder and random spheres. Any tips on how to do that as well, is much appreciated.
  1 件のコメント
John D'Errico
John D'Errico 2018 年 6 月 16 日
Break a problem that is too large for you down into small pieces. Then solve each piece, one at a time. Here, first, think of how you define a circle, thus a center, and a radius.
What is the distribution of the centers? IF the distribution is uniform, do you know how to generate points uniformly in a square?
How about the radius? Do you know how to generate a random number?
If not, then why are you not reading the tutorials?
Can you generate one circle at a time, using a loop? Of course. You can do it all at once in one vectorized call, but so what? Generate them. Save them in an array of centers and radii.
So proceed from one step to the next. Given a set of circles, what is the overlap? Given one circle, can you compute the overlap with a single other circle? So then it is just a loop. Or, perhaps you can think of how to solve this problem approximately using image processing techniques.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by