Borrar filtros
Borrar filtros

Generate the fix radius circles within a specific area

1 visualización (últimos 30 días)
Jordan
Jordan el 15 de Jul. de 2021
Respondida: KSSV el 16 de Jul. de 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?

Respuesta aceptada

KSSV
KSSV el 16 de Jul. de 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

Más respuestas (0)

Categorías

Más información sobre Calendar en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by