Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clockByKuba( h, m, s )
- % clockByKuba( h, m, s )
- % Analog clock from digital time h:m:s
- % r=10;
- % x = [-10 : 0.1: 10];
- % y=sqrt(r^2-x.^2);
- % y = [y, -y];
- % x = [x -x];
- % plot(x, y)
- r=10;
- alfa = 0:pi/180:2*pi;
- x = r *cos(alfa);
- y = r *sin(alfa);
- plot(x,y)
- hold;
- r1=7.5;
- r2=9.5;
- alfa1 = pi/6:pi/6:2*pi;
- 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)], 'r')
- end
- r3=8.5;
- alfa2 = pi/30:pi/30:2*pi;
- x1 = r3 *cos(alfa2);
- y1 = r3 *sin(alfa2);
- x2 = r2 *cos(alfa2);
- y2 = r2 *sin(alfa2);
- for i=1:60
- plot([x1(i), x2(i)], [y1(i), y2(i)], 'g')
- end
- alfa3=pi/2-pi*s/30;
- xs = 7 * cos(alfa3);
- ys = 7* sin (alfa3);
- plot([0, xs], [0, ys], 'b')
- alfa4=pi/2-pi*m/30 - pi*s/30/60;
- xm = 5.5 * cos(alfa4);
- ym = 5.5* sin (alfa4);
- plot([0, xm], [0, ym], 'r')
- alfa5=pi/2-pi*m/30 - pi*s/30/60;
- xh = 4 * cos(alfa4);
- yh = 4 * sin (alfa4);
- plot([0, xh], [0, yh], 'b')
- hold;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement