文件名称:c语言画图示例
文件大小:18KB
文件格式:DOC
更新时间:2015-08-12 18:18:34
figure put
题目:一个最优美的图案。 1.程序分析:2.程序源代码:#include "graphics.h"#include "math.h"#include "dos.h"#include "conio.h"#include "stdlib.h"#include "stdio.h"#include "stdarg.h"#define MAXPTS 15#define PI 3.1415926struct PTS {int x,y;};double AspectRatio=0.85;void LineToDemo(void){struct viewporttype vp;struct PTS points[MAXPTS];int i, j, h, w, xcenter, ycenter;int radius, angle, step;double rads;printf(" MoveTo / LineTo Demonstration" );getviewsettings( &vp; );h = vp.bottom - vp.top;w = vp.right - vp.left;xcenter = w / 2; /* Determine the center of circle */ycenter = h / 2;radius = (h - 30) / (AspectRatio * 2);step = 360 / MAXPTS; /* Determine # of increments */angle = 0; /* Begin at zero degrees */for( i=0 ; i