Posts

Showing posts with the label Computer Graphics Practicals

Computer Graphics Practicals and Programs(CGM)

Image
    AIM - Write a program of line drawing using Digital Differential Analyzer    (DDA) algorithm.                   #include<iostream.h> #include<conio.h> #include<math.h> #include<graphics.h> void main() {           clrscr();           int x1,y1,x2,y2,dx,dy,step,i;           int gd=DETECT,gm;           float xinc,yinc,x,y; initgraph(&gd,&gm,"c:\\tc\\bgi"); cout<< "Enter the coordinates : \n\n";           cout<<"\n(x1,y1) : ";           cin>>x1>>y1;           cout<<"\n(x2,y2) : ";      ...