Private Const p = 3.141592653
Private Sub Command1_Click()
Dim a As Single
Dim y As Single
Dim x As Single
x = Val(Text1.Text)
If x > 270 Then
y = 3 * Sin(x * p / 180) + 6 * Cos(5 * x * p / 180)
ElseIf x > 60 And x < 180 Then
y = 2 * Cos(x * p / 180) - 1
Else
y = 0
End If
Text2.Text = y
End Sub