VB2010-繪製正弦波
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim g As Graphics = Me.CreateGraphics
Dim D As Single
Dim X As Single, ShfX As Single
Dim Y As Single, ShfY As Single
Dim R As Single
Dim lX As Single
Dim lY As Single
lX = -1000
lY = -1000
ShfX = 200
ShfY = 120
R = 100
g.DrawLine(Pens.Black, 0, ShfY, 400, ShfY)
g.DrawLine(Pens.Black, ShfX, 0, ShfX, 250)
For D = -180 To 180
X = D + ShfX
Y = Math.Sin(D * 3.14192653589 / 180) * R + ShfY
If lX = -1000 Then
lX = X
End If
If lY = -1000 Then
lY = Y
End If
g.DrawLine(Pens.Black, lX, lY, X, Y)
lX = X
lY = Y
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
源自於
http://e0935487916.ddns.net/svbr81/index_middle_drawing.php.htm
2017年12月11日 星期一
訂閱:
張貼留言 (Atom)
WOKWI LED + MQTT Node-Red SQLite
WOKWI LED + MQTT Node-Red SQLite const char *mqtt_broker = "broker.mqtt-dashboard.com" ; const char *topic1 = "alex9ufo/e...
-
python pip 不是内部或外部命令 -- 解決方法 要安裝 Pyqt5 1. 首先,開啟命令提示字元。 2. 輸入 pip3 install pyqt5 好像不能執行 ! ! 錯誤顯示 : ‘ pip3 ’ 不是內部或外部命令、可執行的程式或批...
-
課程講義 下載 11/20 1) PPT 下載 + 程式下載 http://www.mediafire.com/file/cru4py7e8pptfda/106%E5%8B%A4%E7%9B%8A2-1.rar 11/27 2) PPT 下載...
-
• 認 識 PreFix、InFix、PostFix PreFix(前序式):* + 1 2 + 3 4 InFix(中序式): (1+2)*(3+4) PostFix(後序式):1 2 + 3 4 + * 後 序式的運算 例如: 運算時由 後序式的...
沒有留言:
張貼留言