VERSION 5.00
Begin VB.Form Form1 
   ClientHeight    =   4590
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5520
   LinkTopic       =   "Form1"
   ScaleHeight     =   306
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   368
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer Timer1 
      Left            =   4320
      Top             =   2520
   End
   Begin VB.CommandButton cmdtest 
      Caption         =   "TEST"
      Height          =   1095
      Left            =   3600
      TabIndex        =   7
      Top             =   480
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   255
      Left            =   1440
      TabIndex        =   1
      Top             =   240
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   1095
   End
   Begin VB.Line Line9 
      X1              =   200
      X2              =   216
      Y1              =   256
      Y2              =   272
   End
   Begin VB.Line lnHand 
      BorderColor     =   &H000000FF&
      X1              =   120
      X2              =   120
      Y1              =   176
      Y2              =   80
   End
   Begin VB.Line Line8 
      BorderColor     =   &H0000FF00&
      X1              =   216
      X2              =   24
      Y1              =   108
      Y2              =   108
   End
   Begin VB.Line Line6 
      BorderColor     =   &H0000FF00&
      X1              =   188
      X2              =   188
      Y1              =   176
      Y2              =   32
   End
   Begin VB.Shape Shape1 
      Height          =   2895
      Left            =   360
      Shape           =   3  'Circle
      Top             =   1200
      Width           =   2895
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "100%"
      Height          =   195
      Left            =   3120
      TabIndex        =   6
      Top             =   960
      Width           =   390
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "75%"
      Height          =   195
      Left            =   2400
      TabIndex        =   5
      Top             =   960
      Width           =   300
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "50%"
      Height          =   195
      Left            =   1680
      TabIndex        =   4
      Top             =   960
      Width           =   300
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "25%"
      Height          =   195
      Left            =   960
      TabIndex        =   3
      Top             =   960
      Width           =   300
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "0%"
      Height          =   195
      Left            =   240
      TabIndex        =   2
      Top             =   960
      Width           =   210
   End
   Begin VB.Line Line5 
      X1              =   216
      X2              =   216
      Y1              =   104
      Y2              =   80
   End
   Begin VB.Line Line7 
      X1              =   168
      X2              =   168
      Y1              =   104
      Y2              =   80
   End
   Begin VB.Line Line4 
      X1              =   72
      X2              =   72
      Y1              =   104
      Y2              =   80
   End
   Begin VB.Line Line1 
      X1              =   24
      X2              =   24
      Y1              =   104
      Y2              =   80
   End
   Begin VB.Line lnBottom 
      BorderColor     =   &H00FF0000&
      X1              =   24
      X2              =   216
      Y1              =   176
      Y2              =   176
   End
   Begin VB.Line Line3 
      X1              =   120
      X2              =   120
      Y1              =   176
      Y2              =   80
   End
   Begin VB.Line Line2 
      X1              =   120
      X2              =   216
      Y1              =   176
      Y2              =   80
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdtest_Click()
Static i
ChangeGraph (i)
Text1 = i
i = i + 1
If i = 101 Then i = 0
End Sub

Private Sub Command1_Click()
ChangeGraph Int(Text1)
Text1.SelStart = 0
Text1.SelLength = Len(Text1)
End Sub

Sub ChangeGraph(iPercent As Integer)
Dim center_lnBottom_X As Long, center_lnBottom_Y As Long 'points where lnHand meets lnBottom
Dim width_lnBottom As Long
width_lnBottom = lnBottom.X2 - lnBottom.X1
center_lnBottom_Y = lnBottom.Y1 + ((lnBottom.Y2 - lnBottom.Y1) / 2)
center_lnBottom_X = lnBottom.X1 + ((lnBottom.X2 - lnBottom.X1) / 2)

Line9.Y1 = center_lnBottom_Y
Line9.X1 = center_lnBottom_X

Dim h As Long, Radius As Long  'hypothonuse/radius
Dim Angle As Double
Dim a As Long, b As Long ' A(X Axis), B(Y Axis)
Const PI = 3.14159265
 
h = Shape1.Width / 2

Angle = iPercent * PI / 100 'now 0 to 180 deg. change 100 to 50 for 0 to 360 deg.

a = Cos(Angle) * h
b = Sin(Angle) * h

'MsgBox "a: " & a & vbCrLf & "b: " & b

lnHand.Y2 = lnHand.Y1 - b
lnHand.X2 = lnHand.X1 - a

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call Command1_Click
End Sub

'radius^2 = x^2 + y^2
' as..
'x = Cos(angle) * radius
'y = Sin(angle) * radius
'angle€0-2pi

'    For a = 0 To 6.283 Step 1 / 100 '2 pi
'            PSet (X + 100 * Cos(a), Y + 100 * Sin(a)), vbBlue
'    Next a

