#include <stdlib.h>
#include <stdio.h>
#include<math.h>
int main()
{
int gm;
int gd=DETECT;
int x1,x2,x3,y1,y2,y3,nx1,nx2,nx3,ny1,ny2,ny3;
int shx,shy;
initwindow(1200,600);
printf("\n\t Enter the three points of a triangle: ");
setcolor(6);
setlinestyle(0,0,3);
scanf("%d%d%d%d%d%d",&x1,&y1,&x2,&y2,&x3,&y3);
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x1,y1);
setcolor(4);
printf("\n Enter the shearing factor");
scanf("%d%d",&shx,­);
nx1=x1+y1*shx;
ny1=y1+x1*shy;
nx2=x2+y2*shx;
ny2=y2+x2*shy;
nx3=x3+y3*shx;
ny3=y3+x3*shy;
line(nx1,ny1,nx2,ny2);
line(nx2,ny2,nx3,ny3);
line(nx3,ny3,nx1,ny1);
getch();
closegraph();
}
0 comments:
Post a Comment