vb绘制立体花瓣
答案:1 悬赏:20 手机版
解决时间 2021-04-05 11:33
- 提问者网友:刺鸟
- 2021-04-04 18:42
vb绘制立体花瓣
最佳答案
- 五星知识达人网友:千杯敬自由
- 2021-04-04 19:47
Const pi As Single = 3.14159265
Private Sub Command1_Click()
Dim i As Integer, j As Integer
Dim a As Integer, k As Integer
Dim x As Integer, y As Integer
Dim x0 As Integer, y0 As Integer
a = Val(Text2.Text)
k = Val(Text1.Text)
Cls
For i = 0 To 10 * a Step a
For j = 1 To 360
x = 50 * (1 + Sin(k * (j) / 180 * pi)) * Cos((i + j) / 180 * pi)
y = 50 * (1 + Sin(k * (j) / 180 * pi)) * Sin((i + j) / 180 * pi)
'PSet (x * 10 + 1500, y * 10 + 1500)
Line (x0 * 10 + 1500, y0 * 10 + 1500)-(x * 10 + 1500, y * 10 + 1500)
x0 = x
y0 = y
Next
Next
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer
Dim a As Integer, k As Integer
Dim x As Integer, y As Integer
Dim x0 As Integer, y0 As Integer
a = Val(Text2.Text)
k = Val(Text1.Text)
Cls
For i = 0 To 10 * a Step a
For j = 1 To 360
x = 50 * (1 + Sin(k * (j) / 180 * pi)) * Cos((i + j) / 180 * pi)
y = 50 * (1 + Sin(k * (j) / 180 * pi)) * Sin((i + j) / 180 * pi)
'PSet (x * 10 + 1500, y * 10 + 1500)
Line (x0 * 10 + 1500, y0 * 10 + 1500)-(x * 10 + 1500, y * 10 + 1500)
x0 = x
y0 = y
Next
Next
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯