/* DDA Techinique to Draw a striaght Line */ #include <stdio.h> #include <conio.h> #include <graphics.h> #include <math.h> void main() { int gd=DETECT,gm; int x1,x2,y1,y2,xinc,yinc; int i,step; float dx,dy; initgraph(&gd,&gm,"c:\\tc\\bgi"); printf("\nEnter 1st End Points x1 & y1 : \n"); scanf("%d %d",&x1,&y1); printf("\nEnter 2nd End points x2 & y2 : \n "); scanf("%d %d",&x2,&y2); dx=x2-x1; dy=y2-y1; if(abs(dx) > abs(dy)) step=abs(dx); else step=abs(dy); xinc=dx/step; yinc=dy/step; putpixel(x1,y1,BLUE); for(i=1; i<=step; i++) {
24

# practical record for computer graphics (B.tech cse) UPTU

Jul 15, 2015

## Engineering

#### step float dx

Welcome message from author
Transcript

/* DDA Techinique to Draw a striaght Line */#include #include #include #include void main() { int gd=DETECT,gm; int x1,x2,y1,y2,xinc,yinc; int i,step; float dx,dy; initgraph(&gd,&gm,"c:\\tc\\bgi"); printf("\nEnter 1st End Points x1 & y1 : \n"); scanf("%d %d",&x1,&y1); printf("\nEnter 2nd End points x2 & y2 : \n "); scanf("%d %d",&x2,&y2); dx=x2-x1; dy=y2-y1; if(abs(dx) > abs(dy)) step=abs(dx); else step=abs(dy); xinc=dx/step; yinc=dy/step; putpixel(x1,y1,BLUE); for(i=1; i

Related Documents
##### B.tech-CSE Scheme Batch 2013
Category: Documents
##### UPSEE / UPTU B.Tech Government College...
Category: Documents
##### mg universuty b.tech cse full syllabus
Category: Documents
##### DATABASE MANAGEMENT SYSTEMS B.TECH CSE II YEAR II …
Category: Documents
##### II b.tech Cse r10 Jntuk Syllabus
Category: Documents
##### Indian Railway Training for B.Tech [UPTU/GBTU/MTU/RGPV]
Category: Documents
##### Program Outcome B.Tech CSE
Category: Documents
##### B.TECH CSE COURSE SYLLABUS
Category: Documents
##### II/IV B.TECH.(CSE) I - SEMESTER · 2 III/IV B.TECH.(CSE) II...
Category: Documents
##### B.TECH IN ENGINEERING CSE/IT III SEMESTER
Category: Documents
##### CSE B.Tech 17-18 -B.Tech... · The department offers B.Tech...
Category: Documents
##### B.tech MDU Syllabus (CSE) 4yr "F" Scheme
Category: Documents