概要:'Points格式:'Points(0):X'Points(1):Y'Points(2):H'...公式:Area=1/2*(x1*y2-x2*y1+x2*y3-x3*y2+... ...+xn*x1-x1*yn)Private Function Area(Points() As Double) As Double '计算Points()区域面积 Dim L As Long L = UBound(Points) - 3 Dim T1 As Long Dim S As Double S = 0 For T1 = 0 To L Step 3 S = S + Points(T1) * Points(T1 + 4) - Points(T1 + 1) * Points(T1 + 3) Next T1 S = S + Points(T1) * Points(1) - Points(T1 + 1) * Points(0) Area = Abs(S / 2)
计算区域面积[VB/VBA函数],标签:工程测量规范,工程测量技术,http://www.67jzw.com'Points格式:
'Points(0):X
'Points(1):Y
'Points(2):H
'...公式:Area=1/2*(x1*y2-x2*y1+x2*y3-x3*y2+... ...+xn*x1-x1*yn)
Private Function Area(Points() As Double) As Double '计算Points()区域面积
Dim L As Long
L = UBound(Points) - 3
Dim T1 As Long
Dim S As Double
S = 0
For T1 = 0 To L Step 3
S = S + Points(T1) * Points(T1 + 4) - Points(T1 + 1) * Points(T1 + 3)
Next T1
S = S + Points(T1) * Points(1) - Points(T1 + 1) * Points(0)
Area = Abs(S / 2)
End Function
上一篇:利用真数(级数展开)公式和垂距趋近正反算曲线程序(for 4850P)
《计算区域面积[VB/VBA函数]》相关文章