小弟初学vb,编程遇到难题,请教各位高手大侠!
小弟在网上搜了一个反正玄函数的代码,用手计算的时候,非常合适,但用vb编程后运用,则不行,感觉是我编程有问题,请各位高手指点,不胜感激!程序如下:FunctionArcS...
小弟在网上搜了一个反正玄函数的代码,用手计算的时候,非常合适,
但用vb编程后运用,则不行,感觉是我编程有问题,请各位高手指点,不胜感激!程序如下:
Function ArcSin(x As Double) As Double
If x >= -1 And x < -0.5 Then ArcSin = -Atn(Sqr(1 - x * x) / x) - 2 * Atn(1)
If x >= -0.5 And x <= 0.5 Then ArcSin = Atn(x / Sqr(1 - x * x))
If x > 0.5 And x <= 1 Then ArcSin = -Atn(Sqr(1 - x * x) / x) + 2 * Atn(1)
End Function
Private Sub Command1_Click()
Dim a As Double
a = Val(Text1.Text)
Text2.Text = ArcSin(a)
End Sub
小弟邮箱为lylsmdy@163.com,可直接发送! 展开
但用vb编程后运用,则不行,感觉是我编程有问题,请各位高手指点,不胜感激!程序如下:
Function ArcSin(x As Double) As Double
If x >= -1 And x < -0.5 Then ArcSin = -Atn(Sqr(1 - x * x) / x) - 2 * Atn(1)
If x >= -0.5 And x <= 0.5 Then ArcSin = Atn(x / Sqr(1 - x * x))
If x > 0.5 And x <= 1 Then ArcSin = -Atn(Sqr(1 - x * x) / x) + 2 * Atn(1)
End Function
Private Sub Command1_Click()
Dim a As Double
a = Val(Text1.Text)
Text2.Text = ArcSin(a)
End Sub
小弟邮箱为lylsmdy@163.com,可直接发送! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询