Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function zegar (h,m,s)
- alfa = 0:pi/180:2*pi;
- r=10;
- x= r*cos(alfa);
- y= r*sin(alfa);
- hold on
- plot(x,y);
- alfa1=0:pi/6:11*pi/6;
- r1=8;
- r2 = 9;
- x1 = r1*cos(alfa1);
- y1 = r1*sin(alfa1);
- x2 = r2*cos(alfa1);
- y2 = r2*sin(alfa1);
- for i=1:12
- plot([x1(i),x2(i)],[y1(i),y2(i)],'g')
- end
- alfah=pi/2-h*pi/6-m*pi/30/12;
- r3=5;
- yh= r3*sin(alfah);
- xh= r3 *cos(alfah);
- plot([0,xh],[0,yh],'r')
- alfam = pi/2-m*pi/30;
- r4 =7;
- ym= r4 *sin(alfam);
- xm= r4 * cos(alfam);
- plot([0,xm],[0,ym],'b')
- alfas = pi/2-s*pi/30;
- r5 =9;
- ys= r5 *sin(alfas);
- xs= r5 * cos(alfas);
- plot([0,xs],[0,ys],'y')
- hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement