North Face Asked:2022-03-25 19:42:52 +0000 UTC2022-03-25 19:42:52 +0000 UTC 2022-03-25 19:42:52 +0000 UTC 如何确定一个形状的面积(以像素为单位)? 772 如何从数组[Point(x1,y1), Point(x2,y2),..Point(xN,yN)]中确定一个图形的面积(以像素为单位)? c# 1 个回答 Voted Best Answer MBo 2022-03-25T20:43:15Z2022-03-25T20:43:15Z 实现高斯面积公式(又名鞋带) private double getArea(Collection<Point> allPoint) { double area = 0; for (int i = 0; i < allPoint.Count; i++) { int j = (i + 1) % allPoint.Count; Point a = allPoint[i], b = allPoint[j]; area += a.X * b.Y - a.Y * b.X; } return Math.Abs(area) / 2; }
实现高斯面积公式(又名鞋带)