title: Polygon area calculation using Latitude and Longitude
body: <p>I am using a solution I've found in this post:
  <a href="https://stackoverflow.com/questions/2861272/polygon-area-calculation-using-latitude-and-longitude-generated-from-cartesian-s">Polygon area calculation using Latitude and Longitude generated from Cartesian space and a world file</a></p>
  
  <p><a href="https://i.stack.imgur.com/U7STQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U7STQ.jpg" alt="Denver football field"></a></p>
  
  <p>There is something wrong because the values I am getting are not real. For example we know a football field should have around 5,300.00 square meters, right? but the calculation is giving 5,759,154.21.</p>
  
  <p>This is the code:</p>
  
  <pre><code>    private static double CalculatePolygonArea(IList&lt;Position&gt; coordinates)
      {
          double area = 0;
  
          if (coordinates.Count &gt; 2)
          {
              for (var i = 0; i &lt; coordinates.Count - 1; i++)
              {
                  Position p1 = coordinates[i];
                  Position p2 = coordinates[i + 1];
                  area += (ConvertToRadian(p2.Longitude) - ConvertToRadian(p1.Longitude)) * (2 + Math.Sin(ConvertToRadian(p1.Latitude)) + Math.Sin(ConvertToRadian(p2.Latitude)));
              }
  
              area = area * 6378137 * 6378137 / 2;
          }
  
          return Math.Abs(area);
      }
  
      private static double ConvertToRadian(double input)
      {
          return input * Math.PI / 180;
      }
  </code></pre>
  
  <p>What can be wrong here? Any help?</p>