134.沙丘图案
【摘要】
/* Sandhill */#include <graphics.h>#include <math.h>#define PI 3.1415926void main(){ double a,b,c; int x,y,py; int gdriver=DETECT,gmode; initgraph(&gdriv...
-
/* Sandhill */
-
#include <graphics.h>
-
#include <math.h>
-
#define PI 3.1415926
-
void main()
-
{
-
double a,b,c;
-
int x,y,py;
-
int gdriver=DETECT,gmode;
-
initgraph(&gdriver,&gmode,"c:\\tc");
-
cleardevice();
-
setbkcolor(9);
-
setcolor(14);
-
outtextxy(80,3,"This program show the Sandhill picture.");
-
-
for(py=20;py<=380;py+=3)
-
{
-
c=(py-20)*4*PI/360;
-
b=PI*cos(c);
-
for(a=0;a<=6*PI;a+=PI/7)
-
{
-
x=600/(6*PI)*a+20;
-
y=10*sin(a+cos(a)*PI-b)*cos(c)+py;
-
if(a==0)
-
moveto(x,y);
-
else
-
lineto(x,y);
-
}
-
}
-
outtextxy(80,460,"Press any key to quit...");
-
getch();
-
closegraph();
-
}
文章来源: blog.csdn.net,作者:程序员编程指南,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/weixin_41055260/article/details/124665171
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)