绘制美丽玫瑰代码.pdf

function plot_rose draw_main(450,90); function draw_main(x,y) %粉红色玫瑰 arcdata{1}=[65 -60 150 350 8 66 -54 300 470 8 65 -56 30 230 10 64 -57 300 490 17]; ellipsedata{1}=[73 -30 250 450 27 40 59 -30 100 290 27 40 65 -40 140 270 20 30]; arcdata{2}=[0 0 150 350 12 1 8 280 470 12 0 2 30 230 16 0 3 80 240 28 2 8 180 330 22 -2 2 310 460 25]; ellipsedata{2}=[-12 30 120 300 30 40 10 28 250 423 30 42 -4 10 290 393 30 40]; ellipsedata{3}=[120 5 0 360 15 25]; ellipsedata{4}=[-70 10 0 360 14 20]; rose_e{2}=[x+16 y+32 235 355 26 35 x-15 y+32 190 310 30 35 x+0 y+35 190 350 43 50]; rose_e{1}=[x+80 y-48 220 350 22 50 x+50 y-48 190 320 22 50 x+65 y-28 180 360 36 50]; rose_e{3}=[x+120 y-6 200 340 17 25 x+120 y+7 160 380 17 27]; rose_e{4}=[x-70 y+15 140 390 17 20 x-75 y-10 205 340 10 30 x-60 y-10 195 340 5 30]; arcdata{3}=[0 82 190 350 6]; ss={ m ,r ,b,y }; s0={ k,k ,g}; figure( menubar ,none,numbertitle ,off ,name,美丽玫瑰 ); %figure(numbertitle,off,name,rose); hold on for j=1:length(ellipsedata) for i=1:size(ellipsedata{j},1) rectangle(Position ,[x+ellipsedata{j}(i,1)-ellipsedata{j}(i,5),y+ellipsedata{j}(i,2)-ellipsedata{j}(i, 6),2*ellipsedata{j}(i,5),2*ellipsedata{j}(i,6)], Curvature ,[1,1], FaceColor ,ss{j}) end if j4 for i=1:size(arcdata{j},1) draw_arc(x+arcdata{j}(i,1),y+arcdata{j}(i,2),arcdata{j}(i,3),arcdata{j}(i,4),arcdata{j}(i,5),s0{j}); end end for i=1:size(rose_e{j},1) plot_rose_e(rose_e{j},j); end end for j=1:3 zhuzhi=[x-98,y+100+j,255,371,100,80 x-20,y+30+j,260,358,140,140 x+224,y+20+j,180,218,160,140]; draw_branch(zhuzhi); end ce_branch=[x+70,y+34,180,233,140,140; x,y+40,205,255,100,120; x+135,y-30,209,249,72,

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档