[code lang-vb]'다각형면적구하기 (출처 : http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/)
Type tPoint
X As Double
Y As Double
End Type
Function PolygonArea(N As Integer, Points() As tPoint) As Double
Dim i As Integer, j As Integer
Dim area As Double
area = 0
For i = 0 To N - 1
j = (i + 1) Mod N
area = area + Points(i).X * Points(j).Y - Points(j).X * Points(i).Y
Next i
PolygonArea = area / 2
End Function[/code]
Posted by solarview

