#include<stdio.h>
#include<graphics.h>
#include<math.h>
#include<conio.h>
#include<dos.h>
int xc=50,yc=200,r=35;
int x[15],y[15];
void drawcircles()
{
setcolor(YELLOW);
circle(xc,yc,r);
circle(xc,yc,r+5);
}
void main()
{
double angle=0,theta;
int i,a;
int gd=DETECT,gm;
initgraph(&gd,&gm,"..\\bgi");
a=xc+r;
while(!kbhit())
{
while(a<=630)
{
theta=M_PI*angle/180;
cleardevice();
drawcircles();
for(i=0;i<18;i++)
{
theta=M_PI*angle/180;
x[i]=xc+r*cos(theta);
y[i]=yc+r*sin(theta);
angle+=20;
line(xc,yc,x[i],y[i]);
}
angle+=2; xc+=2; a=xc+r;
delay(50);
}
xc=50; r=35; a=xc+r;
}
getch();
closegraph();
}
Not Satisfied ? Just search & get the result
Related posts:
- C Program – Implement 3-D rotation with respect to x-axis, y-axis and z-axis
- C Program – Implement the midpoint circle drawing algorithm
- C program – Moving Car
- C Program – Draw a rectangle and perform the operations.
- C Program – Create a house and perform the operations.
Tagged as:
C program - Rotation of wheel,
C program to for Rotation of wheel,
Rotation of wheel
Me, freelance system administrator having the qualification of Diploma in Electronics & Tele-communication + MCSE + CCNA + CST + 5 years of experience in IT field.
If you like This post, you can follow TheOnlineTutorials on Twitter.
Contact me Via email: support@theonlinetutorials.com
Subscribe to feed via Feed or EMAIL to receive instant updates.
Legal Disclaimer:All information found on the site is without any implied warranty of fitness for any purpose or use whatsoever. Content author/site administrator is not responsible for any loss occurred due to mistakes in this tutorial. Use this tutorial website at your own risk.