关于在C语言下的函数曲线
各位大侠,小弟编程水平很低,现请教高手如何在C语言环境下编程实现会绘制函数曲线 如:绘制Y=X2 (1<X<3)的曲线,谢谢!
差不多就是这样的: #include<stdio.h> #include<graphics.h> void init(); void draw_xy(); main() { float i; init(); draw_xy(); for(i=-10;i<10.0;i=i+0.01) putpixel(175+i,200-i*i,RED); getch();
} void init() { int gd=DETECT,gm; initgraph(&gd,&gm,""); cleardevice(); } void draw_xy() { setcolor(RED); line(50,200,300,200); outtextxy(300,198,">"); line(175,50,175,400); outtextxy(172,49,"\136");}