回复 6楼 lianyicq
程序代码:
If ye(k1) < shu Then
shu = ye(k1)
zdj = k1
End If
Next k1
shu = -(Val(Text1.Text) + Val(Text2.Text) + 15 * Sqr(3)) '最低点纵坐标
For i = 50 To 180
If ye(i) < shu Then
shu = ye(i)
zdj = i
Exit For
End If
Next i
Dim xj(1 To 20), yj(1 To 20)
u = 0
For i = 0 To 360
If Abs(ye(i) - ye(zdj) - 20) < 1.5 Then
u = u + 1
xj(u) = xe(i)
yj(u) = ye(i) '找秧苗与水平面的交点
End If
Next i
numx = u '找到的点个数
xkdis = 0 '计算穴口大小
For i = 2 To numx
If Abs(xj(i) - xj(1)) > xk Then
xk = Abs(xj(i) - xj(1) )
Text9.Text = Format(xk, "0.00")
End If
Next i
这个可以吧,感觉稍微有点问题,你能看出来不?嘿嘿