❶ 請教:用c語言怎麼建立坐標系
怎麼在C語言的圖形模式下實現勻速圓周運動?為什麼我用圓的對稱性的方程做出來的是變速的(就是建立一個直角坐標系,X由從小到大遞增,然後畫出點)?
#include "stdio.h" 
#include "math.h" 
#include "graphics.h" 
#include "conio.h" 
#define R 50 /*半徑*/  
#define V 100000 /*延遲時間*/  
main() 
{ 
 int x,y,ta,tb,a=1; 
 ta=DETECT; 
 initgraph(&ta,&tb,"c:\\tc");/*初始化圖形驅動*/ 
 x=-R; 
 while(1) 
 { 
  x+=a;/*X的遞增或遞減(由a而定)*/ 
  y=sqrt(R*R-x*x)*a; /*方程*/  
  putpixel(x+240,y+250,7);/*畫點*/ 
  delay(V);/*延時*/ 
  putpixel(x+240,y+250,0);/*擦除點*/ 
  if(x==R||x==-R)/*換方向*/ 
  a=-a; 
 if(bioskey(1)!=0)/*控制退出的(按下任意鍵結束)*/ 
 break; 
 } 
 closegraph();  
}
❷ C語言如何畫以一維數組為橫坐標,和縱坐標的圖
dimp(b.length-1)aspoint
foriasinteger=0tob.length-1
p(i).x=b(i)
p(i).y=h-a(i)'這里h是你要繪制曲線的控制項的高度
next
然後在窗體或者picturebox的paint事件中:
'畫筆
DimblackPenAsNewPen(Color.Black)
'繪制曲線
e.Graphics.DrawLines(blackPen,p)
❸ c語言怎麼繪制坐標軸
在C語言中,繪制坐標軸可以使用圖形庫來實現。常見的圖形庫包括graphics.h和SDL等。以下是使用graphics.h庫來繪制坐標軸的步驟:
1. 引入graphics.h頭文件梁哪差,使用initgraph函數來初始化圖形環境。
2. 使用line函數繪制x軸和y軸。例如,繪制x軸可以使用line(0, y, screenWidth, y),其中y為x軸所在的y軸坐標,screenWidth為屏幕寬度。
3. 繪制坐標軸上的刻度和標簽。可以使用outtextxy函數來在指定位置繪制文字,使用line函數來繪制刻度線。
4. 繪制坐標軸上的數據點。可以橡皮使用圓形、方形等圖形來表示數據點。
5. 結束繪圖操作,使用closegraph函數關閉圖形環境緩沖。
需要注意的是,在使用graphics.h庫時,需要在編譯選項中添加-lgraphics選項來鏈接庫文件。同時,繪圖操作需要在圖形界面中完成,因此需要在Windows系統上運行程序。
❹ 求教高手:怎麼用C語言畫坐標圖
用graphics。h 裡面的畫圖函數···
 至於 怎麼樣讀excel,你網路一下
用vc寫比較好點
❺ c語言 坐標
#include <graphics.h> 
#include <stdlib.h> 
#include <stdio.h> 
#include <conio.h> 
 
int main(void) 
{ 
      int gdriver = DETECT, gmode, errorcode; 
   int xmax, ymax; 
 initgraph(&gdriver, &gmode, ""); \*初試化圖形*/
 
      errorcode = graphresult(); 
   
   if (errorcode != grOk) 
   { 
      printf("Graphics error: %s\n", 
             grapherrormsg(errorcode)); 
      printf("Press any key to halt:"); 
      getch(); 
      exit(1); 
   } 
 
   setcolor(getmaxcolor()); \*可以選擇顏色比如color(2)是一種顏色*/
   xmax = getmaxx(); 
   ymax = getmaxy(); 
line(0, 0, xmax, ymax); 
 
     getch(); 
   closegraph(); 
   return 0; 
} 
自己遠行一下看看就明白了
