哪位大神能帮忙看看这个要怎么改?(二维图形按照一定比例缩放)
#include <graphics.h>#include <conio.h>
void main(){
//initgraph(900, 900);
//绘制坐标轴
setorigin(450,450);
setaspectratio(1,-1);//缩放因子为负,实现坐标轴的翻转
setcolor(WHITE);
line(-450,0,450,0);//x轴
line(0,450,0,-450);//y轴
//五边形的坐标
static double x1[] = {50.0, 0.0, 100.0, 200.0,150.0 };
static double y1[] = { -50.0, -100.0, -150.0,-100.0,-50.0};
static double x2[5],y2[5];
int i;
scale(3);
for(i=0;i<5;i++)
{
x2[i] = affinex(x1[i],y1[i],1.0);
y2[i] = affiney(x1[i],y1[i],1.0)/2;
}
for(i=0;i<4;i++){
line(x2[i],y2[i],x2[i+1],y2[i+1]);
}
getch();
closegraph();
}