Featured Post

Step Wise Project Planning

Planning is the most difficult process in project management. The framework described is called the Stepwise method to help to distinguis...

WRITE A PROGRAM FOR POLYGON CLIPPING.

#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
void main()
{
clrscr();
int x[10],y[10],xcenter,ycenter,radius=100,i,gd=DETECT,gmode;
initgraph(&gd,&gmode,"c:\\tc\\bgi");
cout<<"Enter the center coordinates of decagon:";
cin>>xcenter>>ycenter;
cout<<"Enter the radius";
cin>>radius;
for(i=0;i<=9;i++)
{
x[i]=xcenter+radius*cos(36*i*3.14/180);
y[i]=ycenter+radius*sin(36*i*3.14/180);
}
for(i=0;i<=9;i++)
{
line(xcenter,ycenter,x[i],y[i]);
}
for(i=0;i<=8;i++)
{
line(x[i],y[i],x[i+1],y[i+1]);
}
line(x[9],y[9],x[0],y[0]);
getch();
Closegraph();

}
Previous
Next Post »