Advertisement
akurczyk

Untitled

Apr 3rd, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #include <graphics.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. double pi = M_PI;
  7.  
  8. initwindow(800, 400, "Kolo");
  9. setviewport(400,200,800,400,0);
  10.  
  11. line(0,-200,0,200);
  12. line(-400,0,400,0);
  13.  
  14. int i,j,k,x,y;
  15.  
  16. for(i=0; i<650; i++)
  17. {
  18. //rysowanie
  19. circle(-325+i,-77,75);
  20. for(j=0; j<=10; j++)
  21. {
  22. k = (j*36)+i;
  23. x = -cos( k*(pi/180) ) * 75;
  24. y = -sin( k*(pi/180) ) * 75;
  25. line(-325+i,-77,x-325+i,y-77);
  26. }
  27.  
  28. delay(50);
  29.  
  30. //zamalowywanie
  31. setcolor(0);
  32. circle(-325+i,-77,75);
  33. for(j=0; j<=10; j++)
  34. {
  35. k = (j*36)+i;
  36. x = -cos( k*(pi/180) ) * 75;
  37. y = -sin( k*(pi/180) ) * 75;
  38. line(-325+i,-77,x-325+i,y-77);
  39. }
  40.  
  41. //naprawianie osi
  42. setcolor(7);
  43. line(0,-200,0,200);
  44. }
  45.  
  46. while(!kbhit()) delay(200); //czeka na nacisnienei przycisku i wylacza
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement