Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

#include

#include
#include
#include
#include
#include
#include

<graphics.h>
<stdlib.h>
<stdio.h>
<conio.h>
<iostream.h>
<math.h>
<dos.h>

struct polygon{
int n;
int x[10];
int y[10];
};
polygon p;
void matrixmul2d(int a[3][3],int b[3][3],int c[3][3]){
int i,j,k,temp;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
temp=0;
for(k=0;k<3;k++){
temp+=a[k][j]*b[i][k];
}
c[i][j]=temp;
}
}
}
void matrixmul3d(int a[4][4],int b[4][4]){
int c[4][4]={0};
int i,j,k,temp;
for(i=0;i<4;i++){
for(j=0;j<4;j++){
temp=0;
for(k=0;k<4;k++){
temp+=a[k][j]*b[i][k];
}
c[i][j]=temp;

}
}
}
int translate(int dx,int dy){
int i;
int c[3][3];
c[0][0]=1;c[0][1
]=0;c[0][2]=dx;
c[1][0]=0;c[1][1
]=1;c[1][2]=dy;
c[2][0]=0;c[2][1
]=0;c[2][2]=1;
for(i=0;i<=p.n;i
++){
int a[3][1],b[3][1];
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int radius,ae,be,x1,x2,y1,y2,ah,bh,ap;
clrscr();
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "C:\\TurboC3\\BGI");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode))
;
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
/* clean up */
getch();
closegraph();
return 0;
}

You might also like