CARDIOID

#include"stdio.h"
#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(LIGHTMAGENTA);
outtextxy(20,20,"CARDIOID");
for(a=0.0001;a<7;a+=0.001)
{
putpixel(x+100*(1+cos(a))*cos(a),y+50*(1+cos(a))*sin(a),LIGHTBLUE);
delay(50);
}
getch();
closegraph();
}


go back to the programs pageclick here

Hosted by www.Geocities.ws

1