求助帖 vb 绘图 为甚么没有出图呢
Private Sub Command1_Click()Dim u As Single, X As Single, Y As Single, c As Double, b As Double
Const pi As Single = 3.14159
b = pi / 180
'建立坐标
Picture2.ScaleMode = 0
Picture2.Width = 6000
Picture2.Height = 4000
Picture2.Line (0, 2000)-(ScaleWidth, 2000)
Picture2.Line (3000, 0)-(3000, ScaleHeight)
For c = 0 To 79.84 Step 0.5
u = c * b
X = (Sqr(861.7911 + 27.17 * 27.17 * Cos(u) * Cos(u)) - 27.17 * Cos(u)) * Cos(u)
Y = (Sqr(861.7911 + 27.17 * 27.17 * Cos(u) * Cos(u)) - 27.17 * Cos(u)) * Sin(u)
Picture2.PSet (X, Y), vbRed
Next
For c = 79.85 To 110.32 Step 0.5
u = c * b
X = 24.96 * Cos(u)
Y = 24.96 * Sin(u)
Picture2.PSet (X, Y)
Next
For c = 110.33 To 259.84 Step 0.5
u = c * b
X = (Sqr(861.7911 + 27.17 * 27.17 * Cos(u) * Cos(u)) + 27.17 * Cos(u)) * Cos(u)
Y = (Sqr(861.7911 + 27.17 * 27.17 * Cos(u) * Cos(u)) + 27.17 * Cos(u)) * Sin(u)
Picture2.PSet (X, Y)
Next
For c = 259.85 To 360
u = c * b
X = (Sqr(861.7911 + 27.17 * 27.17 * Cos(u) * Cos(u)) - 27.17 * Cos(u)) * Cos(u)
Y = (Sqr(861.7911 + 27.17 * 27.17 * Cos(u) * Cos(u)) - 27.17 * Cos(u)) * Sin(u)
Picture2.PSet (3000 + X,2000 + Y)
Next
End Sub