葵花托盘

%% load data
n=1:600;
D =1.;
C = 2.2;
a = 53/180 * pi;

theaN=n * a;
Rn = C * sqrt(n);
count = 100;%%为设置小圆内黑点数
%% =========极坐标投影直角坐标===
x = Rn .* cos(theaN);
y = Rn .* sin(theaN);
for i = 1 : 600
thea = 0 : .01 : 2 * pi;
x_1 = D * cos(thea) + x(i);
y_1 = D * sin(thea) + y(i);
num = 2 * pi * rand(1,count);
r_2 = D * rand(1,count);
x_2 = sin(num) .* r_2+ x(i);
y_2 = cos(num) .* r_2 + y(i);
plot(x_1, y_1,'r','linewidth',1.5);
hold on
plot(x_2, y_2,'k.','markersize',1.5);
hold on

end
axis equal

原文地址:https://www.cnblogs.com/Kermit-Li/p/6696165.html