title: Can't calculate the area of regular polygon - wrong result using the tangent formula
body: <p>I have this method for calculating regular polygon area:</p>
  
  <pre><code>
      public double getArea()  {
          return (sideLength *
              sideLength * sides) /
              (4 * Math.tan(180 / (double) sides));
      }
  </code></pre>
  
  <p>for <code>sideLength</code> and <code>sides</code> both being equal to 10 it returns <code>-219.816218</code>.
  " 
  However this online calculator: <a href="https://www.omnicalculator.com/math/regular-polygon-area" rel="nofollow noreferrer">https://www.omnicalculator.com/math/regular-polygon-area</a>
  returns 769.4. What is wrong with my method? The formula I use is specified <a href="https://www.mathopenref.com/polygonregulararea.html" rel="nofollow noreferrer">here</a>
  .</p>