 Hello friends, Myself Darshan Pandit, Assistant Professor from Computer Science and Engineering Department, Walsh and the Institute of Technology, Solapur. Today we are going to study about basic drawing function in computer graphics. At the end of the session, student will be able to draw different graphical objects using various C functions. So in this lecture, we are going to study about how to draw line, rectangle, circle, arc, ellipse, bar, pie slice, sector and polygon. So before going for various objects, just we will see what do you mean by graphics driver, graphics mode, which are required to run the graphics program. So graphics driver is a pointer to an integer specifying graphics driver to be used. It tells the compiler that what graphics driver to use or automatically detect the driver. In all our programs, we use detect macro of graphics.h library that instruct compiler for auto detection of graphics driver. GM, GM is nothing but graphics mode, it is a pointer to an integer that specifies graphics mode to be used. If graphic driver is said to detect, then init graph sets graphics mode to highest resolution available for detected driver. Also we need to specify the directory path where all graphics related functions are stored. So driver directory path specifies the directory path where graphics driver files that is bgf files are located. If directory path is not provided, then it will search for driver files in current working directory. In all of our sample program, we have to change path of directory accordingly where turbo c compiler is installed. Finally bgi directory is placed in turbo c that is turbo c folder, we have to find where turbo c is installed after that we need to find the bgi directory. So lastly close graph function, it unloads the graphics driver and set the screen back to the text mode. So now we will see how to draw line. So line drawing requires x1, y1 and x2, y2 where x1, y1 is a starting point and x2, y2 is a end point rectangle. So rectangle requires x1, y1 and x2, y2 two points that is x1, y1 is top right corner and x2, y2 is bottom left corner circle. The circle drawing require first center point and secondly radius. The center point is given by providing x1, y1 in the circle function and radius. So let us see the program how to draw line rectangle and circle. So we need to include additional header file that is graphics.h after that we need to detect graphics driver and graphics mode after that we need to initialize graphics driver and graphics mode by using init graph and we need to specify the path where bgi folder is stored that is c colon turbo c3 bgi. After that line we have given the coordinates like zero, zero, hundred, hundred. So it will draw the line with the coordinate zero, zero and hundred, hundred. So this is zero, zero and hundred, hundred rectangle. So rectangle they have given the points 150, 50 which is x1, y1 and 300, hundred x2, y2. So in this way we will get the rectangle circle center point is 400 comma 16 that is x1, y1 with the radius 50. So in this way we will get line rectangle and circle. So next function to draw arc. So it requires parameter int x int y. So this is the center point from where we are drawing the arc, int st angle, st angle is nothing but start angle, int end angle and int radius. So in the diagram you can see so this is the starting angle, end angle and radius. The program based on arc, so in the program the center point is 200, 200, starting angle is 90, end angle is zero with the radius 100. So this will draw the arc. So in this way we will get the arc. So why there is need of providing path of bg. So bg is nothing but borderline graphics interface. It contains graphics library bundled with several borderline compiler when we specify the path in C program the library loads graphics driver and vector fonts which are required to run the program. Function to draw ellipse while drawing ellipse we require x radius and y radius. So this require int x int y that is the center point after that int st angle, st angle is the start angle, int end angle, int xr and int yr, xr and yr is nothing but x radius and y radius. So let us see the program. So in the program so the center point is 200, 200, starting angle is 90 degree, end angle is zero, x radius is 100 and y radius is 180. So this will draw the ellipse with given x radius and y radius. So this is the x radius and here we are having y radius. So one thing you have to remember so here in graphics the coordinates are coordinate system is in a reverse order that is this is x axis and here you are having y axis and here you are having coordinate 0 comma 0 and while drawing any object so this system is considered and object is being drawn. So in this way we will get the ellipse. So in this lecture we have seen how to draw line, circle, arc and ellipse. So these are the references which have been used to create this video that is Wikipedia, CS, Corollado and TechCrashCourse.com Thank you.