Posts

Showing posts from May, 2020
Image
How to draw lines ?  And basic maths to draw lines in graphics programming with c graphics . To understand the graphics program you must need to understand the simple math behind graphics programming.  To draw lines in c, especially we need graphics.h header file, line( ) , and some graphic driver codes to initialize the graph . #include<conio.h> #include<graphics.h> void main( ) { clrscr( ); int gd=DETECT,gm; initgraph(&gd,&gm, "c:\\tc\\bgi") ; line(100,200,400,300); getch( ); closegraph( ); } Here in this code you can see  line function, there are four arguments are present within line ( ), so now here you have to pass four arguments within line ( ); line(100,200,400,300); to understand the line( ) and arguments of line( ),we will consider the line( ) like this. void line(int x1 ,int y1 ,int x2 ,int y2 );  or   line( x1 , y1 , x2 , y2 ); here you can see four int type arguments are present within line function. These a