这是我的代码,可就是不知道怎么改,求大神帮忙!

老师让我用c语言画一个小球平抛轨迹图
#include <winbgim.h>
#include <conio2.h>
#include <math.h>
#include <time.h>
#define PI 3.1415926
int main()
{
time_t now;
int x,y;
initwindow(1000,700); //open a 640x480 graphics window
setcolor(WHITE); 
circle(100,50,10); //Draw a circle
floodfill(100,50,WHITE);//在圆内填充白色; 
bar(0,60,100,65);//上面板 
bar(100,565,850,570);//下面板
setcolor(WHITE);
now=time(NULL); 
setwritemode(1);
while(now==1000)
{
x=100+100*now;
y=50+(1/2)*10*now*now;
setcolor(WHITE);
cricle(x,y,10);
delay(1000/24);
cricle(x,y,10);  
}
getch(); //wait for user to press a key
closegraph(); //close graphics window
return 0;
}

慕容708150
浏览 110回答 1
1回答

蛊毒传说

circle函数是TURBO C提供的图形接口,用来画圆。不属于标准库函数,不具备可移植性。函数名:circle功 能: 在给定半径以(x, y)为圆心画圆用 法:void far circle(int x, int y, int radius)随时间变化,可以用cleardevice函数清除屏幕,不断画半径不同的圆。看起来就像是一个随时间变化的圆形。函数名: cleardevice功 能: 清除图形屏幕用 法: void far cleardevice(void);例程:#include&nbsp;<graphics.h>#include&nbsp;<stdlib.h>#include&nbsp;<stdio.h>#include&nbsp;<conio.h>int&nbsp;main(void){/*&nbsp;request&nbsp;auto&nbsp;detection&nbsp;*/int&nbsp;gdriver&nbsp;=&nbsp;DETECT,&nbsp;gmode,&nbsp;errorcode;int&nbsp;midx,&nbsp;midy;int&nbsp;radius&nbsp;=&nbsp;100;/*&nbsp;initialize&nbsp;graphics&nbsp;and&nbsp;local&nbsp;variables&nbsp;*/initgraph(&gdriver,&nbsp;&gmode,&nbsp;"");/*&nbsp;read&nbsp;result&nbsp;of&nbsp;initialization&nbsp;*/errorcode&nbsp;=&nbsp;graphresult();if&nbsp;(errorcode&nbsp;!=&nbsp;grOk)&nbsp;/*&nbsp;an&nbsp;error&nbsp;occurred&nbsp;*/{printf("Graphics&nbsp;error:&nbsp;%s\n",&nbsp;grapherrormsg(errorcode));printf("Press&nbsp;any&nbsp;key&nbsp;to&nbsp;halt:");getch();exit(1);&nbsp;/*&nbsp;terminate&nbsp;with&nbsp;an&nbsp;error&nbsp;code&nbsp;*/}midx&nbsp;=&nbsp;getmaxx()&nbsp;/&nbsp;2;midy&nbsp;=&nbsp;getmaxy()&nbsp;/&nbsp;2;setcolor(getmaxcolor());for(i=0;i<1000000;i++)&nbsp;if(i%50000==0){&nbsp;&nbsp;&nbsp;&nbsp;cleardevice();/*&nbsp;clean&nbsp;the&nbsp;screen&nbsp;*/&nbsp;&nbsp;&nbsp;&nbsp;circle(midx,&nbsp;midy,&nbsp;radius--);/*&nbsp;draw&nbsp;the&nbsp;circle&nbsp;*/}getch();closegraph();return&nbsp;0;}
打开App,查看更多内容
随时随地看视频慕课网APP