欢迎来到http://www.gong66.com !
当前位置:六六工程资料网建筑课堂工程资料工程测量计算区域面积[VB/VBA函数]

计算区域面积[VB/VBA函数]

08-22 13:58:42  浏览次数:541次  栏目:工程测量
标签:工程测量规范,工程测量技术, 计算区域面积[VB/VBA函数],http://www.gong66.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,计算区域面积[VB/VBA函数]

++《计算区域面积[VB/VBA函数]》相关文章