matlab数学之美多边形边接半圆
% matlab画雪花
clear;clc;close all;
% 背景设置为黑色
figure('Color', 'w');
set(groot, 'defaultAxesColor', 'w');
% 颜色包
for nm=2:69
cmap=load(['D:\matlab_work\函数名为colormore的颜色索引表制作\colormore_txt\colormore_',num2str(nm),'.txt']);
% 画图
% 底座
for ij=1:5
t=0:pi/ij:2pi;
for jj=1:30
R=jj;
x=R cos(t);
y=Rsin(t);
plot(x,y,'color',cmap(jj 3,:),'LineStyle','-','LineWidth',2)
hold on
% 花朵
t0=-pi/ij:0.01:2/ijpi;
for i=1:length(x)-1
plot(R/2 cos(t0)+((x(i)+x(i+1))/2),R/2sin(t0)+((y(i)+y(i+1))/2),'color',cmap(jj 3,:),'LineStyle','-','LineWidth',2)
t0=t0+pi/ij;
hold on
end
end
axis equal
set(gca,'xtick',[],'xticklabel',[],'xcolor','w','ytick',[],'yticklabel',[],'ycolor','w')
xlim([-(R+20) (R+20)])
ylim([-(R+20) (R+20)])
export_fig([num2str(ij),'_',num2str(nm),'2.jpg'],'-r300')
close all
end
end