Const Cv As Double = 0.0174532
Convert angle: 0.0174532 grad to other units
Select input unit of angle: | 0.0174532 grad equals to: | |
0.01570788 deg (degree)
0.000274154 rad (radian) 8.7266E-5 π rad (pi radian) 0.0174532 grad 4.3633E-5 full-circle |
Public Class Form1
Dim Painting As Bitmap
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Painting = New Bitmap(400, 400)
Dim G As Graphics = Graphics.FromImage(Painting)
Const CX As Integer = 200
Const CY As Integer = 200
Const Hp As Integer = 10
Const Hl As Integer = 50
Const Hw As Integer = 5
Const Mp As Integer = 10
Const Ml As Integer = 70
Const Mw As Integer = 3
Const Fm As Integer = 90
Const Fw As Integer = 8
Const Cv As Double = 0.0174532
Dim HD As Integer
Dim MD As Integer
Dim DP As Pen
HD = Hp / 12 * 360
MD = Mp / 60 * 360
DP = New Pen(Color.Red, Hw)
G.DrawLine(DP, CX, CY, CSng(CX + Hl * Math.Sin(HD * Cv)), CSng(CY - Hl * Math.Cos(HD * Cv)))
DP = New Pen(Color.Blue, Mw)
G.DrawLine(DP, CX, CY, CSng(CX + Ml * Math.Sin(MD * Cv)), CSng(CY - Ml * Math.Cos(MD * Cv)))
DP = New Pen(Color.Green, Fw)
G.DrawArc(DP, CX - Fm, CY - Fm, Fm * 2, Fm * 2, 0, 360)
Me.BackgroundImageLayout = ImageLayout.None
Me.BackgroundImage = Painting
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
沒有留言:
張貼留言