本文介绍了如何计算座标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好!
Hello!
#include <graphics.h>
#include <conio.h>
main()
{
int gd=DETECT,gm,points[]={320,150,420,300,250,300,320,150};
initgraph(&gd, &gm, "C:\\TC\\BGI");
drawpoly(4, points);
getch();
closegraph();
return 0;
}
他是如何计算这些点的?
谢谢.
How did he calculate those points ?
Thanks.
推荐答案
..........................................
..........................................
..........................................
..........................................
...................X......................
..........................................
..........................................
..........................................
..........................................
..........................................
.....Z...........................Y........
..........................................
..........................................
..........................................
..........................................
..........................................
..........................................
..........................................
...................W......................
1. Fix point W
[X.x = W.x], [X.y = W.y + sqrt(2)*sideLength]
[Y.x = W.x + sqrt(2)*sideLength*0.5], [Y.y = (W.y + X.y) * 0.5]
[Z.x = Y.x - sqrt(2)*sideLength], [Z.y = Y.y]
这篇关于如何计算座标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!