Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

SANTA CLAUS' HAT in MATLAB

Join us: https://www.facebook.com/groups/MATLABCODES/ 
Join us on Telegram : https://t.me/matlabirawen


clc
clear all
close all
figure;
axis([-5 5 -5 5]);
fill([-5 5 5 -5],[-5 -5 5 5],'k');
axis square;
pause(5);
hold on;
x=[-4 4 0 -4];
y=[-3 -3 3 -3];
patch(x,y,'r');
pause(1);
hold on;
t=0:0.01:2*pi;
x=0.6*cos(t);
y=3.6+0.6*sin(t);
fill(x,y,'w');
pause(1);
axis square;
hold on;
temp=0.5;
x1=[];
tum=-4;
x1=[x1 tum];
for i=1:30
    if(tum<4)
        tum=tum+1;
        x1=[x1 tum];
    end
end
for i=1:length(x1)
    t=0:0.01:2*pi;
    a=x1(i);
    b=-3;
    x=a+0.5*cos(t);
    y=b+0.5*sin(t);
    fill(x,y,'w');
    pause(0.6);
    axis square;
    hold on;
end

No comments

Popular Posts

Followers