Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<windows.h>
  2. #include<math.h>
  3. #include<graphics.h>
  4. const float pi = 3.14159265359;
  5. int main()
  6. {
  7. float x= 400,y=400,r=100, t = 0.0;
  8. float scale = 0.1;
  9. initwindow(800,600,"");
  10. while(true)
  11. {
  12.  
  13. cleardevice();
  14. x = r*cos(t) + 150;
  15. y = r*sin(t) + 150;
  16.  
  17. circle(150*scale,150*scale,120*scale);
  18. setcolor(5);
  19. circle(x*scale,y*scale,20*scale);
  20. t=t<2*pi?t+0.05:0;
  21. Sleep(10);
  22. }
  23. getch();
  24. closegraph();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement