Dancing Circles.
By SalimMeghani
- 363 reads
Public Class Form1
' Rotation, Dancing Circles
' By Salim Shahbudeen Meghani April 2018.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
40: Dim PI As Double
PI = 3.1415926#
Dim C As Integer
Dim dm As Double
Dim g As Integer
Dim d As Double
Dim x As Integer
Dim y As Integer
g = 4
75:
Dim x2 As Integer
Dim y1 As Integer
Dim k As Double
For C = 1 To 5
50: For dm = 0 To 63 Step 0.25
70:
Dim a As Integer
Dim x1 As Integer
d = Math.Cos(g) + 1
For a = 150 To 75 Step -25
80: For k = 0 To 2 * PI Step PI / 12
90: x = 570 + a * Math.Cos(k - d * dm)
y = 250 + a * Math.Sin(k + d * dm)
' y1 = 250 + a * Math.Sin(k - d * dm)
' x1 = 150 + a * Math.Cos(k + d * dm)
' x2 = 1000 + a * Math.Cos(k + d * dm)
120:
CreateGraphics.DrawEllipse(Pens.Black, x, y, 100, 100)
' CreateGraphics.DrawEllipse(Pens.Red, x1, y1, 100, 100)
' CreateGraphics.DrawEllipse(Pens.Blue, x2, y1, 100, 100)
130: Next k
Next a
160:
For a = 150 To 75 Step -25
170: For k = 0 To 2 * PI Step PI / 12
180: x = 570 + a * Math.Cos(k - d * dm)
y = 250 + a * Math.Sin(k + d * dm)
' y1 = 250 + a * Math.Sin(k - d * dm)
' x1 = 150 + a * Math.Cos(k + d * dm)
' x2 = 1000 + a * Math.Cos(k + d * dm)
210: CreateGraphics.DrawEllipse(Pens.LightGray, x, y, 100, 100)
'CreateGraphics.DrawEllipse(Pens.LightGray, x1, y1, 100, 100)
'CreateGraphics.DrawEllipse(Pens.LightGray, x2, y1, 100, 100)
220: Next k
Next a
270: Next
Next
End Sub
End Class
'Set windowstate to maximised, and background color to LightGray.
- Log in to post comments