指导下,咋红色圆不围绕黑色圆做圆周运动??谢谢了,指导下
圆周运动.zip
(2.15 KB)
Option Explicit Dim xa(-360 To 360) As Double Dim ya(-360 To 360) As Double Const PI = 3.14159 Public Sub zuobiao() Dim L1 As Integer L1 = Val(Text1.Text) Dim k1 As Integer For k1 = 0 To 360 xa(k1) = L1 * Cos(k1 * PI / 180) ya(k1) = L1 * Sin(k1 * PI / 180) Next k1 End Sub Private Sub Command1_Click() Timer1.Enabled = True Picture1.Cls End Sub Private Sub Form_Load() Picture1.Scale (-80, 80)-(80, -80) Picture1.Circle (0, 0), 10, RGB(0, 0, 0) Picture1.Circle (20, 0), 10, RGB(255, 0, 0) Picture1.Line (0, 0)-(20, 0), RGB(0, 0, 0) End Sub Private Sub Timer1_Timer() Call zuobiao Dim k2 As Integer Picture1.Circle (0, 0), 10, RGB(0, 0, 0) Picture1.Circle (xa(k2), ya(k2)), 10, RGB(255, 0, 0) Picture1.Line (0, 0)-(xa(k2), ya(k2)), RGB(0, 0, 0) End Sub