{"id":632,"date":"2020-06-09T14:45:42","date_gmt":"2020-06-09T13:45:42","guid":{"rendered":"https:\/\/thomasjansen.eu\/?p=632"},"modified":"2021-03-03T15:17:39","modified_gmt":"2021-03-03T14:17:39","slug":"area-3d-polygon-on-a-plane","status":"publish","type":"post","link":"https:\/\/thomas-jansen.eu\/?p=632","title":{"rendered":"Area 3D polygon on a plane"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">    static public double getSignedArea(List<xyz> points, XYZ normal)\n    {\n        int nPoints = points.Count;\n\n        XYZ sum = XYZ.Zero;\n        for (int index = 1; index &lt; nPoints; index++)\n        {\n            sum += points[index].CrossProduct(points[index - 1]);\n        }<\/xyz>\n        sum += points[0].CrossProduct(points[nPoints - 1]); \n<xyz>\n        double area = normal.DotProduct(sum);\n        return -0.5 * area;\n    }<\/xyz><\/pre>\n\n\n\n<p>To calculate the area of a 3D polygon on a plane. the normal is the plane&#8217;s normal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>static public double getSignedArea(List points, XYZ normal) { int nPoints = points.Count; XYZ sum = XYZ.Zero; for (int index = 1; index &lt; nPoints; index++) { sum += points[index].CrossProduct(points[index &#8211; 1]); } sum += points[0].CrossProduct(points[nPoints &#8211; 1]); double area = normal.DotProduct(sum); return -0.5 * area; } To calculate the area of a 3D polygon on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[97,99,100,98],"class_list":["post-632","post","type-post","status-publish","format-standard","hentry","category-geometry","tag-area","tag-crossproduct","tag-dotproduct","tag-polygon"],"_links":{"self":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=632"}],"version-history":[{"count":3,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/632\/revisions"}],"predecessor-version":[{"id":649,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=\/wp\/v2\/posts\/632\/revisions\/649"}],"wp:attachment":[{"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas-jansen.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}