aa
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/shopspring/decimal"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/partner"
|
"git.rosy.net.cn/jx-callback/business/partner"
|
||||||
@@ -466,8 +468,7 @@ func CalculateCoverArea(coordinate []string) (area float64) {
|
|||||||
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][1])
|
||||||
}
|
}
|
||||||
sum += (xyList[0][0] - xyList[len(xyList)-1][0]) * (xyList[0][1] + xyList[len(xyList)-1][1])
|
sum += (xyList[0][0] - xyList[len(xyList)-1][0]) * (xyList[0][1] + xyList[len(xyList)-1][1])
|
||||||
fmt.Println("1111111111111111111111111111111111111111", sum)
|
|
||||||
sum /= float64(2)
|
sum /= float64(2)
|
||||||
fmt.Println("1111111111111111111111111111111111111111", sum)
|
area, _ = decimal.NewFromFloat(sum).Round(2).Float64()
|
||||||
return math.Round(sum)
|
return area
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user