CYCLOID
#include"graphics.h"
#include"math.h"
main()
{
int gd=DETECT,gm,x,y,i,j;
float a;
initgraph(&gd,&gm,"c:\\tc\\bgi");
setcolor(RED);
x=getmaxx()/2;
y=getmaxy()/2;
line(x,0,x,480);
line(0,y,640,y);
setcolor(LIGHTBLUE);
outtextxy(20,20,"CYCLOID");
for(a=0;a<22;a+=0.01)
{
putpixel(x+10*(a+sin(a)),y-20*(1+cos(a)),LIGHTMAGENTA);
putpixel(x-10*(a+sin(a)),y-20*(1+cos(a)),LIGHTMAGENTA);
delay(100);
}
getch();
}
Go back to the programs page click here