求助高手一个三角函数公式,如何用VB写出来?Private Sub Form_Load()Dim a,b,c,s1,s2 As Doublea = Text1.Textb = Text2.Textc = a + bs1 = Cos(a * 3.14 / 180)s2 = Cos(a) * Cos(b) + Sin(a) * Sin(b)Text3.Text = s1Text4.Text = s2End Sub目的

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/08 09:18:18
求助高手一个三角函数公式,如何用VB写出来?PrivateSubForm_Load()Dima,b,c,s1,s2AsDoublea=Text1.Textb=Text2.Textc=a+bs1=Cos

求助高手一个三角函数公式,如何用VB写出来?Private Sub Form_Load()Dim a,b,c,s1,s2 As Doublea = Text1.Textb = Text2.Textc = a + bs1 = Cos(a * 3.14 / 180)s2 = Cos(a) * Cos(b) + Sin(a) * Sin(b)Text3.Text = s1Text4.Text = s2End Sub目的
求助高手一个三角函数公式,如何用VB写出来?
Private Sub Form_Load()
Dim a,b,c,s1,s2 As Double
a = Text1.Text
b = Text2.Text
c = a + b
s1 = Cos(a * 3.14 / 180)
s2 = Cos(a) * Cos(b) + Sin(a) * Sin(b)
Text3.Text = s1
Text4.Text = s2
End Sub
目的是为了用
cos(α+β)=cosαcosβ-sinαcosβ
获取a、b,然后分别输出等式两边的值验证.
可是在试运行的时候老出错.
我只是看着书上的,一直没实践过.
很多基础的都不会.

求助高手一个三角函数公式,如何用VB写出来?Private Sub Form_Load()Dim a,b,c,s1,s2 As Doublea = Text1.Textb = Text2.Textc = a + bs1 = Cos(a * 3.14 / 180)s2 = Cos(a) * Cos(b) + Sin(a) * Sin(b)Text3.Text = s1Text4.Text = s2End Sub目的
都写到这个地步了 还上网来问?
Dim a,b,c,k1,k2,s1,s2 As Double
a = Value(Text1.Text);
b = Value(Text2.Text);
k1=a * 3.14 / 180;
k2=b* 3.14 / 180;
s2 = Cos(k1) * Cos(k2) - Sin(k1) * Sin(k2);
s1=cos(K1+K2);
貌似如此!最进在学C++ 语法全乱套.
你的伪代码写的都全了,怎么不去实践实践!