0% found this document useful (0 votes)
30 views5 pages

Computer Graphics Lab Manual: Sachdeva Institute of Technology

This 3 sentence summary provides the key details about the document: The document is a laboratory manual for the Computer Science and IT Department of SACHDEVA INSTITUTE OF TECHNOLOGY in FARAH, MATHURA that contains a list of computer graphics lab experiments including Experiment 1 which implements DDA (digital differential analyzer) algorithms for drawing a digital circle and line on screen using C programming code.

Uploaded by

Amit Mishra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views5 pages

Computer Graphics Lab Manual: Sachdeva Institute of Technology

This 3 sentence summary provides the key details about the document: The document is a laboratory manual for the Computer Science and IT Department of SACHDEVA INSTITUTE OF TECHNOLOGY in FARAH, MATHURA that contains a list of computer graphics lab experiments including Experiment 1 which implements DDA (digital differential analyzer) algorithms for drawing a digital circle and line on screen using C programming code.

Uploaded by

Amit Mishra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Laboratory Manual

CS and IT Department

SACHDEVA INSTITUTE OF
TECHNOLOGY
FARAH, MATHURA.

Computer Graphics Lab


Manual

[Lab NCS-453]

List of Experiments
Q.1 W A P To implement DDA( digital
circle.

differential analyzer)

//in the name of GOD


#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
int x1=30,x2=90,y1=40,y2=100,dx,dy,n,c,step,xi,yi;
initgraph(&gd,&gm,"C:\\TC\\BGI ");
dx=x2-x1;
dy=y2-y1;
if(dx>dy)
{
step=dx;
}

algorithms for line and

else
{
step=dy;
}
xi=dx/step;
yi=dy/step;
while((x1<=x2)&&(y1<=y2))
{
x1=x1+xi;
y1=yi+yi;

putpixel(x1,y1,9);
}
getch();
}

OUTPUT

You might also like