VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "CRO"
   ClientHeight    =   5865
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4785
   Icon            =   "frmMain.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   391
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   319
   StartUpPosition =   2  'CenterScreen
   Begin VB.Frame frmPhase 
      Caption         =   "Phase Difference"
      Height          =   975
      Left            =   0
      TabIndex        =   5
      Top             =   4800
      Width           =   4695
      Begin VB.OptionButton optPhase 
         Caption         =   "45 Deg"
         Height          =   255
         Index           =   1
         Left            =   1200
         TabIndex        =   10
         Top             =   240
         Width           =   855
      End
      Begin VB.OptionButton optPhase 
         Caption         =   "90 Deg"
         Height          =   195
         Index           =   2
         Left            =   2280
         TabIndex        =   9
         Top             =   240
         Width           =   855
      End
      Begin VB.OptionButton optPhase 
         Caption         =   "135 Deg"
         Height          =   195
         Index           =   3
         Left            =   120
         TabIndex        =   8
         Top             =   600
         Width           =   975
      End
      Begin VB.OptionButton optPhase 
         Caption         =   "180 Deg"
         Height          =   195
         Index           =   4
         Left            =   1200
         TabIndex        =   7
         Top             =   600
         Width           =   975
      End
      Begin VB.OptionButton optPhase 
         Caption         =   "0 Deg"
         Height          =   195
         Index           =   0
         Left            =   120
         TabIndex        =   6
         Top             =   240
         Width           =   975
      End
   End
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   0
      Top             =   5760
   End
   Begin VB.HScrollBar H 
      Height          =   255
      Left            =   0
      Max             =   200
      TabIndex        =   2
      Top             =   4500
      Width           =   4455
   End
   Begin VB.VScrollBar V 
      Height          =   4455
      Left            =   4500
      Max             =   200
      TabIndex        =   1
      Top             =   0
      Width           =   255
   End
   Begin VB.PictureBox pic 
      BackColor       =   &H00000000&
      DrawWidth       =   2
      FillStyle       =   0  'Solid
      ForeColor       =   &H0000FF00&
      Height          =   4500
      Left            =   0
      ScaleHeight     =   296
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   296
      TabIndex        =   0
      Top             =   0
      Width           =   4500
      Begin VB.Label lbH 
         BackStyle       =   0  'Transparent
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   255
         Left            =   1920
         TabIndex        =   4
         Top             =   4200
         Width           =   375
      End
      Begin VB.Label lbV 
         BackStyle       =   0  'Transparent
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   255
         Left            =   4080
         TabIndex        =   3
         Top             =   2160
         Width           =   375
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long

Dim X As Single
Dim Y As Single
Dim HValue As Single, VValue As Single
Dim cX As Single, cY As Single
Const DegToRad = 3.14285714285714 / 180
Const W = 150
Dim gLoop As Boolean
Private Sub Form_Load()
Me.Show

While Not gLoop
    DoEvents
    
    If HValue >= 360 Then HValue = 0
    
    X = W + W * Sin(HValue * DegToRad)
    HValue = HValue + 0.1 * H.Value
    

    If VValue >= 360 Then VValue = 0
    Y = W + W * Sin(VValue * DegToRad)
    VValue = VValue + 0.1 * V.Value
    
    drawMe
    DoEvents
Wend
End Sub
Private Sub drawMe()
    pic.Line (cX, cY)-(X, Y)
    cX = X
    cY = Y
    'SetPixel pic.hdc, X, Y, vbGreen
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    gLoop = True
End Sub

Private Sub H_Change()
    lbH.Caption = H.Value
End Sub

Private Sub optPhase_Click(Index As Integer)
    VValue = 0
    HValue = Index * 45
End Sub

Private Sub Timer1_Timer()
    pic.Cls
End Sub

Private Sub V_Change()
    lbV.Caption = V.Value
End Sub
