https://v.qq.com/x/page/c09303khi7w.html
刘金玉的零基础VB教程061期:
常用数学函数第一节
各种常用数学函数汇总:
科学计数法 9.529752 E-02 就是9.529752*10的-2次方
弧度转角度:弧度*180/pi角度转弧度:角度*PI/180
课堂总结
1、学会使用角度函数,注意返回的是弧度单位的数
2、掌握弧度与角度互转的公式
3、掌握自然对数的求解
4、掌握随机数的范围及用法
本期界面:
本期源代码:
Private Sub Command1_Click()
Dim a As Double
a = Val(Text1.Text)
Text2.Text = Abs(a)
End Sub
Private Sub Command2_Click()
Dim a As Double
a = Val(Text1.Text)
Text2.Text = Sin(a)
End Sub
Private Sub Command3_Click()
Dim a As Double
a = Val(Text1.Text)
Text2.Text = Cos(a)
End Sub
Private Sub Command4_Click()
Dim a As Double
a = Val(Text1.Text)
Text2.Text = Tan(a)
End Sub
Private Sub Command5_Click()
Dim a As Double
a = Val(Text1.Text)
Text2.Text = Atn(a)
End Sub
Private Sub Command6_Click()
Dim a As Double
a = Val(Text1.Text)
Text2.Text = Log(a)
End Sub
Private Sub Command7_Click()
Dim a As Double
a = Val(Text1.Text)
Text2.Text = Exp(a)
End Sub
Private Sub Command8_Click()
Randomize
Text2.Text = Rnd
End Sub