Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <graphics.h>
  3. #include<math.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. initwindow(800,800);
  9.  
  10. double x1;
  11. for(int Dx = 1; Dx <= 350; Dx++)
  12. {
  13. delay(2);
  14. x1 = 60 + Dx;
  15. cleardevice();
  16. setlinestyle(0,0,2);
  17. setcolor(12);
  18. circle(x1,60,50);
  19. }
  20.  
  21. double Sy=1.3;
  22. int yf = 10,y = 60;
  23. int y1 = yf + (y - yf)*Sy;
  24. while((y1 - yf) < 250)
  25. {
  26. delay(500);
  27. setcolor(12);
  28. circle(x1,60,50);
  29. circle(x1,y1,y1-yf);
  30. setcolor(12);
  31. y1=yf+(y1-yf)*Sy;
  32. }
  33. circle(x1,y1,y1-yf);
  34. Sy=1.3;
  35. yf = 10;
  36. y = 60;
  37. y1 = yf + (y - yf)*Sy;
  38. while((y1 - yf) < 250)
  39. {
  40. delay(500);
  41. setcolor(BLACK);
  42. circle(x1,60,50);
  43. circle(x1,y1,y1-yf);
  44. y1=yf+(y1-yf)*Sy;
  45. }
  46. double x2;
  47. for(int i=0;i<360;i += 1)
  48. {
  49. delay(5);
  50. double x2=x1+(x1-x1)*cos(i*3.14/180)-(y-y1)*sin(i*3.14/180);
  51. double y2=y1+(x1-x1)*sin(i*3.14/180)+(y-y1)*cos(i*3.14/180);
  52. setcolor(12);
  53. circle(x2,y2,48);
  54. }
  55.  
  56. for(int i=360;i>=0;i -= 1)
  57. {
  58. delay(5);
  59. double x2=x1+(x1-x1)*cos(i*3.14/180)-(y-y1)*sin(i*3.14/180);
  60. double y2=y1+(x1-x1)*sin(i*3.14/180)+(y-y1)*cos(i*3.14/180);
  61. setcolor(BLACK);
  62. circle(x2,y2,48);
  63. }
  64.  
  65.  
  66. system("pause");
  67. return 0;
  68.  
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement