linerel() function is used to draw line from current position to a point where we want to end the line that is at the relative distance from the c.p . This function is used with the moverel() function to draw the line.
- linerel() function contains two parameter. First parameter specifies the X-coordinate.
- Second parameter specifies the Y-coordinate.
- For better understanding go through the program:
int gd = DETECT, gm,x,y;
initgraph(&gd, &gm,” “);
Above program will draw the line from the current position to the specified position (320,240). In the above program moveto() function will move the current position to the new position (20,30) and moverel() function will move the current position with a relative distance to a position (100,100). Finally linerel() function will draw the line from current position to position at relative distance from current position that is (320,240).