Sunday 12 November 2017

Computer Graphics 5- SCALING


Computer Graphics 4- TRANSLATION



dont forget to add
getch();
closegraph();
}


Computer Graphics 3- BRESENHAM’S CIRCLE DRAWING ALGORITHM



Computer Graphics 2- BRESENHAM’S LINE DRAWING ALGORITHM

#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<graphics.h>
main()
{
int gd=DETECT,gm;
int xa,xb,ya,yb;
int dx,dy,x,y,xend,p;
clrscr();
initgraph(&gd,&gm," ");
printf("enter the left end points(xa,ya):");
scanf("%d%d",&xa,ya);
printf("enter the two right end points(xb,yb):");
scanf("%d%d",&xb,&yb);
dx=abs(xa-xb);
dy=abs(ya-yb);
p=2*dy-dx;
if(xa>xb)
{
x=xb;
y=yb;
xend=xa;
}
else
{
x=xa;
y=ya;
xend=xb;
}
putpixel(x,y,6);
while(x<xend)
{
x=x+1;
if(p<0)
{
p=p+2*dy;
}
else
{
y=y+1;
p=p+2*(dy-dx);
}
putpixel(x,y,6);
}
getch();
return 0;
}

Computer Graphics 1- How to draw a DDA Line Algorithm ?

 DDA Line Algorithm ,


#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int x1,y1,x2,y2,dx,dy,i,length;
float x,y,xinc,yinc;
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
printf("enter x coordinates");
scanf("%d%d",&x1,x2);
printf("enter y coordinates");
scanf("%d%d",&y1,y2);
dx=x2-x1;
dy=y2-y1;
if(abs(dx)>abs(dy))
length=abs(dx);
else
length=abs(dy);
xinc=dx/(float)length;
yinc=dy/(float)length;
x=x1;
y=y1;
putpixel(x,y,7);
for(i=0;i<length;i++)
{
putpixel(x,y,7);
x=x+xinc;
y=y+yinc;
delay(10);
}
getch();
closegraph();
}

I Year Supplimentary Question Paper 5 - Computer Organization



I Year Supplimentary Question Paper 2 - Discrete Mathematics




III Year Question Paper 5 - Programming In Java



III Year Question Paper 4 - Computer Networks



III Year Question Paper 3 - Computer Graphics and Multimedia



III Year Question Paper 2 - Internet and Web Applications



III Year Question Paper 1- Software Engineering