Senin, 25 November 2013
2D ANIMATION
#include
#include
#include
#include
#include
void main()
{
clrscr();
int gd=DETECT,gm;
initgraph(&gd,&gm,"D:\\TC\\BGI");
float x1,y1,r;
cout<<"Enter The Radius of The Circle : ";
cin>>r;
cout<<"Enter Center Of Circle : ";
cin>>x1>>y1;
circle(x1,y1,r);
float ang2=1/2;
int i=5000;
do
{
ang2=ang2+(1/r);
int x3,x4,x5,x6,y3,y4,y5,y6;
x3=x1+r*sin(ang2);
y3=y1-r*cos(ang2);
x4=x1+r*sin(ang2+3.1415927);
y4=y1-r*cos(ang2+3.1415927);
x5=x1+r*sin(ang2+1.5707963);
y5=y1-r*cos(ang2+1.5707963);
x6=x1+r*sin(ang2+4.7123890);
y6=y1-r*cos(ang2+4.7123890);
setcolor(2);
line(x3,y3,x4,y4);
setcolor(4);
line(x5,y5,x6,y6);
delay(5);
i--;
}while(i>0);
closegraph();
}
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar