Effacer les filtres
Effacer les filtres

Generate the fix radius circles within a specific area

1 vue (au cours des 30 derniers jours)
Jordan
Jordan le 15 Juil 2021
Réponse apportée : KSSV le 16 Juil 2021
I want to generate the random circle with fix radius within a specific area like 0<x<1 0<Y<1 and each generated circle must be checked with all previously generated circle to make sure there is no interference
the progream will be finished when there is no more room for new circle is any functions there can do this?
  2 commentaires
Jordan
Jordan le 15 Juil 2021
Apologies for the confusion. I mean the area like 0<x<1 0<Y<1

Connectez-vous pour commenter.

Réponse acceptée

KSSV
KSSV le 16 Juil 2021
r = 0.1 ; % radius of circle
x = 0:2*r:1 ;
y = 0:2*r:1 ;
[X,Y] = meshgrid(x,y) ;
th = linspace(0,2*pi) ;
xc = r*cos(th) ; yc = r*sin(th) ;
figure
hold on
for i = 1:length(x)
for j = 1:length(y)
plot(X(i,j)+xc,Y(i,j)+yc) ;
end
end

Plus de réponses (0)

Catégories

En savoir plus sur Calendar dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by