<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why `geometryEngine.planarArea` does not match the results calculated by the Shoelace formula in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-geometryengine-planararea-does-not-match-the/m-p/1176701#M77455</link>
    <description>&lt;P&gt;if the units are meters, then the difference is about 2 millimeters squared over a total area 20 thousand-ish meters squared.&lt;/P&gt;&lt;P&gt;floating point precision and/or math package differences&lt;/P&gt;&lt;P&gt;different methods of calculating area&lt;/P&gt;&lt;P&gt;shoelace doesn't know about coordinate systems&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;some possibilities.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 02:47:20 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-05-24T02:47:20Z</dc:date>
    <item>
      <title>Why `geometryEngine.planarArea` does not match the results calculated by the Shoelace formula</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-geometryengine-planararea-does-not-match-the/m-p/1176699#M77454</link>
      <description>&lt;P&gt;I created an instance and listed two calculation results, the result of `planarArea` is 20423.311146823657, and the result of `Sholace formula` is 20423.328125, the difference is -0.016978176343400264, why is this?&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/yujinpan/pen/BaYwLPG?editors=1001" target="_blank" rel="noopener"&gt;https://codepen.io/yujinpan/pen/BaYwLPG?editors=1001&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is my calculation.&lt;/P&gt;&lt;P&gt;// Shoelace formula&lt;BR /&gt;let total = 0;&lt;BR /&gt;coordinates.forEach(([x, y], index, arr) =&amp;gt; {&lt;BR /&gt;const [nextX, nextY] = arr[index + 1] || arr[0];&lt;BR /&gt;total += (x*nextY - nextX*y)*0.5;&lt;BR /&gt;});&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 02:41:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-geometryengine-planararea-does-not-match-the/m-p/1176699#M77454</guid>
      <dc:creator>yujinpan</dc:creator>
      <dc:date>2022-05-24T02:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why `geometryEngine.planarArea` does not match the results calculated by the Shoelace formula</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-geometryengine-planararea-does-not-match-the/m-p/1176701#M77455</link>
      <description>&lt;P&gt;if the units are meters, then the difference is about 2 millimeters squared over a total area 20 thousand-ish meters squared.&lt;/P&gt;&lt;P&gt;floating point precision and/or math package differences&lt;/P&gt;&lt;P&gt;different methods of calculating area&lt;/P&gt;&lt;P&gt;shoelace doesn't know about coordinate systems&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;some possibilities.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 02:47:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-geometryengine-planararea-does-not-match-the/m-p/1176701#M77455</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-05-24T02:47:20Z</dc:date>
    </item>
  </channel>
</rss>

