新聞| | PChome| 登入
2007-06-10 16:33:43 | 人氣63| 回應0 | 上一篇 | 下一篇
推薦 0 收藏 0 轉貼0 訂閱站台

曲線繪製

 


Private Sub Command1_Click()
'y(t)= -3t2+5 t>=0 -9<=t<=9
Picture1.DrawWidth = 2

For i = -9 To 9 Step 0.05
    ii = Format(i, "##.##")
    yt = Format(-3 * i ^ 2 + 5 * i, "###.##")
    List1.AddItem "t=" & ii & "   ,y(t)=" & yt
   
    px = i * 100
    py = 100 * (-3 * i ^ 2 + 5 * i)
    Picture1.PSet (px, py), RGB(255, 0, 0)
   
Next

End Sub

Private Sub Form_Activate()
Dim Xmin, Xmax, Ymin, Ymax As Integer
Xmin = -300
Xmax = 300
Ymin = -300
Ymax = 300
Picture1.Scale (Xmin, Ymax)-(Xmax, Ymin)
Picture1.DrawWidth = 1

For i = Xmin To Xmax Step 10
    Picture1.PSet (0, i), RGB(0, 0, 0)
Next
For i = Ymin To Ymax Step 10
    Picture1.PSet (i, 0), RGB(0, 0, 0)
Next

End Sub

Private Sub Form_Load()
Label1 = vbCrLf & "y(t)= -3t2+5 t " & vbCrLf & vbCrLf
Label1 = Label1 & "-9<=t<=9"

End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1 = X & "," & Y
End Sub

台長: Kenny
人氣(63) | 回應(0)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 教育學習(進修、留學、學術研究、教育概況) | 個人分類: 程式設計 |
此分類下一篇:分割圖片拼圖遊戲前之圖片分割
此分類上一篇:拉丁方陣動態陣列與動態物件之應用

是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文