How To Create Circles in Circles Animation in C Or C++ (Computer Graphics)

                                                                      PROJECT BY

(SIMPLIFY LEARN PROGRAMMING) 

ON

CIRCLES IN CIRCLE ANIMATION


SOURCE CODE:

#include<graphics.h>

#include<conio.h>

#include<dos.h>

 

main()

{

   int gd = DETECT, gm, x, y, color, angle = 0;

   struct arccoordstype a, b;

 

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   delay(2000);


   while(angle<=360)

   {

      setcolor(BLACK);

      arc(getmaxx()/2,getmaxy()/2,angle,angle+2,100);

      setcolor(YELLOW);

      getarccoords(&a);

      circle(a.xstart,a.ystart,25);

      setcolor(BLACK);

      arc(getmaxx()/2,getmaxy()/2,angle,angle+2,150);

      getarccoords(&a);

      setcolor(GREEN);

      circle(a.xstart,a.ystart,25);

      setcolor(BLACK);

      arc(getmaxx()/2,getmaxy()/2,angle,angle+2,50);

      setcolor(RED);

      getarccoords(&a);

      circle(a.xstart,a.ystart,25);

      angle = angle+5;

      delay(50);

   }


   getch();

   closegraph();

   return 0;

}



OUTPUT:




Comments

Popular posts from this blog

How To Draw a Butterfly Animation in C (Computer Graphics)

How To Draw Sunrise Animation in C++ (Computer Graphics)

How To Draw a Bouncing Ball Animation in C++ (Computer Graphics)