|
我想用C编写一条SIN函数的图形,我编写如下,但运行时只是屏幕一片黑,什么都没有,请问什么原因?????
#include "graphics.h"
#include "math.h"
main()
{
int graphdriver=DETECT,graphmode;
double x1,y1,x2,y2,k;
initgraph(&graphdriver,&graphmode,"");
cleardevice();
x1=100.0;
y1=100.0-75.0*sin(0.0);
moveto(x1,y1);
for(k=0.0;k<359.0;k++)
{
x2=100.0+k;
y2=100.0-75.0*sin(k/180.0*3.14159);
lineto(x2,y2);
}
getch();
closegraph();
} |
|