フィルターのクリア

Generate the fix radius circles within a specific area

1 回表示 (過去 30 日間)
Jordan
Jordan 2021 年 7 月 15 日
回答済み: KSSV 2021 年 7 月 16 日
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 件のコメント
Jordan
Jordan 2021 年 7 月 15 日
Apologies for the confusion. I mean the area like 0<x<1 0<Y<1

サインインしてコメントする。

採用された回答

KSSV
KSSV 2021 年 7 月 16 日
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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by