This commit is contained in:
苏尹岚
2021-03-09 13:42:14 +08:00
parent 83cbb071b0
commit 3c355a16c5

View File

@@ -471,7 +471,7 @@ func CalculateCoverArea(coordinate []string, vendorID int) (area float64) {
}
var sum float64
for i := 0; i < len(xyList)-1; i++ {
sum += (xyList[i+1][0] - xyList[i][0]) * (xyList[i+1][1] + xyList[i+1][1])
sum += (xyList[i+1][0] - xyList[i][0]) * (xyList[i+1][1] + xyList[i][1])
}
sum += (xyList[0][0] - xyList[len(xyList)-1][0]) * (xyList[0][1] + xyList[len(xyList)-1][1])
sum /= float64(2)