VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   2370
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4200
   LinkTopic       =   "Form1"
   ScaleHeight     =   2370
   ScaleWidth      =   4200
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   435
      Left            =   3060
      TabIndex        =   0
      Text            =   "20"
      Top             =   1800
      Width           =   975
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Click()
    Dim r, xi, yi, xj, yj, x0, y0, aif As Single
    Cls
    r = Form1.ScaleHeight / 2                       ' 圆的半径
    x0 = Form1.ScaleWidth / 2                       ' 圆心
    y0 = Form1.ScaleHeight / 2
    n = Val(Text1)                                  ' 等分圆周为n份
    aif = 3.1415926 * 2 / n                         ' 等分角
    For i = 1 To n - 1                              ' 选择(xi, yi)点
        xi = r * Cos(i * aif) + x0
        yi = r * Sin(i * aif) + y0
        For j = i + 1 To n                      ' 选择(xj, yj)点
            xj = r * Cos(j * aif) + x0
            yj = r * Sin(j * aif) + y0
            Line (xi, yi)-(xj, yj)                  ' 等分点连线
        Next j
    Next i
End Sub

