title: Polygon area calculation using Latitude and Longitude generated from Cartesian space and a world file
body: <p>Given a series of GPS coordinate pairs, I need to calculate the area of a polygon (n-gon).  This is relatively small (not larger than 50,000 sqft).  The geocodes are created by applying an affine transform with data from a world file.</p>
  
  <p>I have tried to use a two step approach by doing converting the geocodes to cartesian coordinates:</p>
  
  <pre><code>double xPos = (lon-lonAnchor)*( Math.toRadians( 6378137 ) )*Math.cos( latAnchor );
  double yPos = (lat-latAnchor)*( Math.toRadians( 6378137 ) );
  </code></pre>
  
  <p>then I use a <a href="http://mathworld.wolfram.com/PolygonArea.html" rel="noreferrer">cross product</a> calculation to determine the area.</p>
  
  <p>The issue is that the results are a bit off in accuracy (around 1%).  Is there anything I can look into to improve this?</p>
  
  <p>Thanks.</p>