Concurrent circular patterns: Using C and graphics
Hey guys its very easy and small program to generate concurrent circular patterns. Here's the screen shot of the out put.
Let us see the code, hope you guys like it..
/*
Programmer: Ashok Kumar Shrestha (ak007)
Program details: Generates concurrent circles by using circles.
*/
#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, "..\\BGI");
delay(200);
while(angle<=360)
{
setcolor(BLACK);
arc(getmaxx()/2,getmaxy()/2,angle,angle+2,100);
setcolor(4);
getarccoords(&a);
circle(a.xstart,a.ystart,25);
setcolor(BLACK);
arc(getmaxx()/2,getmaxy()/2,angle,angle+2,150);
getarccoords(&a);
setcolor(2);
circle(a.xstart,a.ystart,25);
setcolor(BLACK);
arc(getmaxx()/2,getmaxy()/2,angle,angle+2,200);
getarccoords(&a);
setcolor(3);
circle(a.xstart,a.ystart,25);
angle = angle+4;
delay(50);
}
getch();
closegraph();
return 0;
}
//End of the program
Let us see the code, hope you guys like it..
/*
Programmer: Ashok Kumar Shrestha (ak007)
Program details: Generates concurrent circles by using circles.
*/
#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, "..\\BGI");
delay(200);
while(angle<=360)
{
setcolor(BLACK);
arc(getmaxx()/2,getmaxy()/2,angle,angle+2,100);
setcolor(4);
getarccoords(&a);
circle(a.xstart,a.ystart,25);
setcolor(BLACK);
arc(getmaxx()/2,getmaxy()/2,angle,angle+2,150);
getarccoords(&a);
setcolor(2);
circle(a.xstart,a.ystart,25);
setcolor(BLACK);
arc(getmaxx()/2,getmaxy()/2,angle,angle+2,200);
getarccoords(&a);
setcolor(3);
circle(a.xstart,a.ystart,25);
angle = angle+4;
delay(50);
}
getch();
closegraph();
return 0;
}
//End of the program
Comments
Post a Comment