static public double getSignedArea(Listpoints, XYZ normal) { int nPoints = points.Count; XYZ sum = XYZ.Zero; for (int index = 1; index < nPoints; index++) { sum += points[index].CrossProduct(points[index - 1]); } sum += points[0].CrossProduct(points[nPoints - 1]);double area = normal.DotProduct(sum); return -0.5 * area; }
To calculate the area of a 3D polygon on a plane. the normal is the plane’s normal.