#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<ctype.h>
#include<stdlib.h>
#define CLIP_ON 1
int rect(int x1,int x2,int y1,int y2);
int tran(int tx,int ty) ;
int x1,y1,x2,y2,tx,ty;
void main()
{
int gdriver=DETECT,gmode,errorcode;
initgraph(&gdriver,&gmode,"c:\tc\bin\bgi");
clrscr();
printf("\n Enter points");
scanf("%d%d%d",&x1,&y1,&x2,&y2);
rect(x1,y1,x2,y2);
printf("\n Enter the value for tx,ty");
scanf("%d%d",&tx,&ty);
tran(tx,ty);
getch();
}
int rect(x1,y1,x2,y2)
{
rectangle(x1,y1,x2,y2);
bar3d(x1,y1,x2,y2,20,1);
}
int tran(tx,ty)
{
rectangle(x1+tx,y1+ty,x2+tx,y2+ty);
bar3d(x1+tx,y1+ty,x2+tx,y2+ty,20,1);
}
#include<conio.h>
#include<graphics.h>
#include<ctype.h>
#include<stdlib.h>
#define CLIP_ON 1
int rect(int x1,int x2,int y1,int y2);
int tran(int tx,int ty) ;
int x1,y1,x2,y2,tx,ty;
void main()
{
int gdriver=DETECT,gmode,errorcode;
initgraph(&gdriver,&gmode,"c:\tc\bin\bgi");
clrscr();
printf("\n Enter points");
scanf("%d%d%d",&x1,&y1,&x2,&y2);
rect(x1,y1,x2,y2);
printf("\n Enter the value for tx,ty");
scanf("%d%d",&tx,&ty);
tran(tx,ty);
getch();
}
int rect(x1,y1,x2,y2)
{
rectangle(x1,y1,x2,y2);
bar3d(x1,y1,x2,y2,20,1);
}
int tran(tx,ty)
{
rectangle(x1+tx,y1+ty,x2+tx,y2+ty);
bar3d(x1+tx,y1+ty,x2+tx,y2+ty,20,1);
}
No comments:
Post a Comment