#include
#include
#include
#include
int x0,y0,x1,y1,tx,ty;
void main()
{
int gdriver=DETECT,gmode,errorcode;
initgraph(&gdriver,&gmode,"c:\tc\bgi");
printf("\nEnter the start points of line:");
scanf("%d%d",&x0,&y0);
printf("\nEnter the end points of line:");
scanf("%d%d",&x1,&y1);
printf("\nEnter the translation co-ordinates:");
scanf("%d%d",&tx,&ty);
setcolor(YELLOW);
line(x0,y0,x1,y1);
setviewport(x0,y0,getmaxx()-20,getmaxy()-20,50);
line(x0+tx,y0+ty,x1+tx,y1+ty);
getch();
}
#include
#include
#include
int x0,y0,x1,y1,tx,ty;
void main()
{
int gdriver=DETECT,gmode,errorcode;
initgraph(&gdriver,&gmode,"c:\tc\bgi");
printf("\nEnter the start points of line:");
scanf("%d%d",&x0,&y0);
printf("\nEnter the end points of line:");
scanf("%d%d",&x1,&y1);
printf("\nEnter the translation co-ordinates:");
scanf("%d%d",&tx,&ty);
setcolor(YELLOW);
line(x0,y0,x1,y1);
setviewport(x0,y0,getmaxx()-20,getmaxy()-20,50);
line(x0+tx,y0+ty,x1+tx,y1+ty);
getch();
}
No comments:
Post a Comment