Page

DDA Line Drawing Algorithm Example in C Language

#include<stdio.h> 
#include<math.h> 
#include<conio.h> 
#include<graphics.h>
#define round(val) (int)(val+0.5) 
void main() 
int gd=DETECT,gm; 
void line_dda(int,int,int,int); 
int xa,xb,ya,yb; 
printf("Enter the two values"); 
scanf("%d%d%d%d",&xa,&ya,&xb,&yb);  initgraph(&gd,&gm,""); 
cleardevice(); 
line_dda(xa,ya,xb,yb); 
getch(); 
closegraph(); 

No comments:

Post a Comment