vb编程问题求大佬解答?
e=Sqr((a*a-ba*ba)/(a*a))这句话显示溢出,我也不知道该怎么改,程序如下。PrivateSubCommand4_Click()Dimb1#,b2#,b...
e = Sqr((a * a - ba * ba) / (a * a))这句话显示溢出
,我也不知道该怎么改 ,程序如下。
Private Sub Command4_Click()
Dim b1#, b2#, b3#, l1#, l2#, l3#
Const pi = 3.14159265358979
b = Text6.Text
l = Text7.Text
h = Text8.Text
b1 = Fix(b): b2 = Fix((b - b1) * 100#)
b3 = (b - b1) * 100# - b2: b3 = b3 * 100#
b = b1 + (b2 / 60#) + (b3 / 3600#)
b = b * pi / 180#
l1 = Fix(l): l2 = Fix((l - l1) * 100#)
l3 = (l - l1) * 100# - l2: l3 = l3 * 100#
l = l1 + (l2 / 60#) + (l3 / 3600#)
l = l * pi / 180#
ba = a - (1 / 298.257) * a
e = Sqr((a * a - ba * ba) / (a * a))
N = a / Sqr(1 - e * e * Sin(b) * Sin(b))
X = (N + h) * Cos(b) * Cos(l)
Y = (N + h) * Cos(b) * Sin(l)
z = (N * (1 - e * e) + h) * Sin(b)
Text3.Text = X
Text4.Text = Y
Text5.Text = z
End Sub 展开
,我也不知道该怎么改 ,程序如下。
Private Sub Command4_Click()
Dim b1#, b2#, b3#, l1#, l2#, l3#
Const pi = 3.14159265358979
b = Text6.Text
l = Text7.Text
h = Text8.Text
b1 = Fix(b): b2 = Fix((b - b1) * 100#)
b3 = (b - b1) * 100# - b2: b3 = b3 * 100#
b = b1 + (b2 / 60#) + (b3 / 3600#)
b = b * pi / 180#
l1 = Fix(l): l2 = Fix((l - l1) * 100#)
l3 = (l - l1) * 100# - l2: l3 = l3 * 100#
l = l1 + (l2 / 60#) + (l3 / 3600#)
l = l * pi / 180#
ba = a - (1 / 298.257) * a
e = Sqr((a * a - ba * ba) / (a * a))
N = a / Sqr(1 - e * e * Sin(b) * Sin(b))
X = (N + h) * Cos(b) * Cos(l)
Y = (N + h) * Cos(b) * Sin(l)
z = (N * (1 - e * e) + h) * Sin(b)
Text3.Text = X
Text4.Text = Y
Text5.Text = z
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询