134.沙丘图案

简介: 134.沙丘图案
/* 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();
}
相关文章
|
3月前
一个最优美的图案
一个最优美的图案。
211 58
|
5月前
|
数据可视化 定位技术 开发者
黑白或彩色线稿地图设计定制装饰画中线条轮廓素材底图获取方法合集
黑白或彩色线稿地图设计定制装饰画中线条轮廓素材底图获取方法合集
|
6月前
颜色拾取器
颜色拾取器
25 0
|
9月前
|
编译器 Windows
<1>[QTCN]颜色拾取器
桌面置顶 获取全局鼠标坐标和颜色(Web值、RGB) 新增: 按下鼠标右键停止/开启
57 1
|
10月前
Photoshop制作空心圆柱体与立体烟缸
Photoshop制作空心圆柱体与立体烟缸
86 0
EasyX颜色+绘制彩虹色天空
今天夜里想搞一搞easyx(doge)
105 0