vb设计求三角函数的绝对值的程序
2个回答
展开全部
今天搜集各类资料终于做出来了。
Private Sub Command1_Click()
Const pi = 3.1415926
Dim rotate As Double
rotate = Text1.Text
x = rotate
S = Format(Abs(Sin(x * pi / 180)), "0.00")
C = Format(Abs(Cos(x * pi / 180)), "0.00")
Text2.Text = Text2.Text & Space(10) & x & Space(10) & S & Space(10) & C & vbCrLf
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
可以改进。
Private Sub Command1_Click()
Const pi = 3.1415926
Dim rotate As Double
rotate = Text1.Text
x = rotate
S = Format(Abs(Sin(x * pi / 180)), "0.00")
C = Format(Abs(Cos(x * pi / 180)), "0.00")
Text2.Text = Text2.Text & Space(10) & x & Space(10) & S & Space(10) & C & vbCrLf
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
可以改进。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询