2 回答

TA貢獻1804條經(jīng)驗 獲得超2個贊
1、先定義坐標系,即XY軸。
2、根據(jù)具體需要,調(diào)用內(nèi)部函數(shù),或自定義函數(shù),繪制函數(shù)圖像。
3、代碼供參考:
Me.AutoRedraw = True
Me.Width = 8000: Me.Height = 6000
Me.Scale (-10, 2)-(10, -2)
Line (0, -2)-(0, 2)
Line (-20, 0)-(20, 0)
For i! = -2 To 2 Step 0.5
Line (0, i)-(0.5, i)
CurrentX = -1.8
CurrentY = i
Print i
Next i
For j! = -8 To 10 Step 2
Line (j, 0)-(j, 0.05)
CurrentX = j - 0.5
CurrentY = 0
If Abs(j) > 0 Then Print j
Next j
For k = -10 To 10 Step 0.01
PSet (k, Sin(k)), vbRed
PSet (k, Cos(k)), vbBlue
Next k

TA貢獻1810條經(jīng)驗 獲得超4個贊
用描點的方法吧
Form1.PSet (x, Sin(x))
Private Const PI = 3.14159265358979
Private Sub Command1_Click()
w = 5 * PI
h = w * Picture1.Height / Picture1.Width
Picture1.Scale (-w, h)-(w, -h)
k = Picture1.ScaleWidth / Picture1.Width
Debug.Print Picture1.Width
Picture1.Line (-w, 0)-(w, 0)
Picture1.Line (0, -h)-(0, h)
For x = -2 * PI To 2 * PI Step k
Picture1.PSet (x, Sin(x))
Next
End Sub
- 2 回答
- 0 關(guān)注
- 947 瀏覽
添加回答
舉報