首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
帮我改下错误

我是个宝宝2017-06-12 22:52 发布

#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.1415926
struct pts {
int x, y;
};
double aspectratio = 0.85;
void linetodemo(void)
{
typedef 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; irads = (double)angle * pi / 180.0; /* convert angle to radians */
points[i].x = xcenter + (int)(cos(rads) * radius);
points[i].y = ycenter - (int)(sin(rads) * radius * aspectratio);
angle += step; /* move to next increment */
}
circle(xcenter, ycenter, radius); /* draw bounding circle */
for (i = 0; ifor(j = i; jmoveto(points[i].x, points[i].y); /* move to beginning of cord */
lineto(points[j].x, points[j].y); /* draw the cord */

main()
{
int driver, mode;
driver = cga; mode = cgac0;
initgraph(&driver, &mode, "");
setcolor(3);
setbkcolor(green);
linetodemo();
}
 
 
最新话题:

毕业(真实版本)堪萨斯州立大学毕业证...

毕业(真实版本)丹佛大学毕业证书-|DU...

毕业(真实版本)加州大学河滨分校毕业...

毕业(真实版本)爱荷华州立大学毕业证...

const char

帮我改下错误

请教下怎么修改cpp(10) : error C218...

Merge函数该怎么写,把P2中的数据插...