Sub Globals
'Declare the global variables here.
DegRad = cPI/180
RadDeg = 180/cPI
End Sub
Sub App_Start
Form1.Show
End Sub
Sub btnRecPor_Click
radius = Sqrt((txtx.Text^2) + (txty.Text^2))
angle = ATan(txty.Text/txtx.Text * RadDeg)
txtanswer.Text = "Radius " & Format(radius,"n2") & " -- " & "Angle " & Format(angle,"n5")
End Sub
Sub btnPolRec_Click
x = txtx.Text * Cos(txty.Text * degrad)
y = txtx.Text * Sin(txty.Text * degrad)
txtanswer.Text = "x " & Format(x,"n2") & " ------ " & "y " & Format(y,"n2")
End Sub
Sub btnClear_Click
txtx.Text = ""
txty.Text = ""
txtanswer.Text = ""
End Sub