Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. function zegar (h,m,s)
  2. alfa = 0:pi/180:2*pi;
  3. r=10;
  4. x= r*cos(alfa);
  5. y= r*sin(alfa);
  6. hold on
  7. plot(x,y);
  8. alfa1=0:pi/6:11*pi/6;
  9. r1=8;
  10. r2 = 9;
  11. x1 = r1*cos(alfa1);
  12. y1 = r1*sin(alfa1);
  13. x2 = r2*cos(alfa1);
  14. y2 = r2*sin(alfa1);
  15. for i=1:12
  16. plot([x1(i),x2(i)],[y1(i),y2(i)],'g')
  17. end
  18. alfah=pi/2-h*pi/6-m*pi/30/12;
  19. r3=5;
  20. yh= r3*sin(alfah);
  21. xh= r3 *cos(alfah);
  22. plot([0,xh],[0,yh],'r')
  23.  
  24. alfam = pi/2-m*pi/30;
  25. r4 =7;
  26. ym= r4 *sin(alfam);
  27. xm= r4 * cos(alfam);
  28. plot([0,xm],[0,ym],'b')
  29.  
  30. alfas = pi/2-s*pi/30;
  31. r5 =9;
  32. ys= r5 *sin(alfas);
  33. xs= r5 * cos(alfas);
  34. plot([0,xs],[0,ys],'y')
  35. hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement