#include <stdlib.h>
#include <stdio.h>
#include<math.h>
int main()
{
int gm;
int gd=DETECT;
int x1,x2,x3,y1,y2,y3;
int sx,sy;
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 scalling factor");
scanf("%d%d",&sx,&sy);
line(x1*sx,y1*sy,x2*sx,y2*sy);
line(x2*sx,y2*sy,x3*sx,y3*sy);
line(x3*sx,y3*sy,x1*sx,y1*sy);
getch();
closegraph();
}
0 comments:
Post a Comment