I made a demo in vb.net:
CODE
Dim paljuon As Integer = CInt(Val(Me.tekst.Text))
Dim raadius As Integer = CInt(Val(Me.tekst2.Text))
Dim a As Single, b As Single, c As Single
Dim q As Single = 20 + raadius * 2
Using MyPen As New Pen(Color.LightBlue, CInt(Val(Me.tekst3.Text))), _
taust As Graphics = Me.CreateGraphics()
Dim x1 As Single = 10 + raadius
Dim y1 As Single = 10 + raadius
Dim x2 As Single
Dim y2 As Single
For i As Integer = 1 To paljuon
a = CType(raadius / paljuon, Single) * i
c = raadius
b = CType(Math.Sqrt(c ^ 2 - a ^ 2), Single)
x2 = 10 + raadius + a
y2 = 10 + b
taust.DrawLine(MyPen, x1, q - y1 - raadius, x2, q - y2 - raadius)
taust.DrawLine(MyPen, q - x1, q - y1 - raadius, q - x2, q - y2 - raadius)
taust.DrawLine(MyPen, x1, y1 + raadius, x2, y2 + raadius)
taust.DrawLine(MyPen, q - x1, y1 + raadius, q - x2, y2 + raadius)
x1 = x2
y1 = y2
Application.DoEvents()
Next
End Using
Probably one could correct math a bit, but basically, it works
Hope it helped