为什么调试的时候总是提示我说xt = tana / (2 * a * u)这除数为0
求帮忙看一下呗,真心谢谢了,找不到哪里出错Dim tana, delta, step, u, texpr, xp, yp, xt, yt, k, xb, yb, del As Double
Dim xa, ya As Single
Private Sub Command1_Click()
a = Val(Text1.Text)
m = Val(Text3.Text)
xa = Val(Text6.Text)
Text4.Text = "xb=" & Str(xb) & vbCrLf & "yb=" & Str(yb)
ya = a * x ^ 2
For tana = delta To 0.00001 Step m
u = Sqr(delta ^ 2 - tana ^ 2)
texpr = 4 * a * u ^ 3 + 4 * a * u * tana ^ 2 - 4 * a * u ^ 2 * ya - tana ^ 2 + 4 * a * u * tana * xa
If texpr < 0.00001 And texpr > 0 Then Exit For
Next
xp = xa + tana: yp = ya + u
xt = tana / (2 * a * u): yt = a * xt ^ 2
k = (yp - yt) / (xp - xt)
del = Sqr(k ^ 2 - 4 * a * (k * xa - ya))
xb = (k + del) / (2 * xa)
yb = a * xb ^ 2
End Sub