diff --git a/index.js b/index.js index 4aba334..f663863 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,7 @@ function polygonArea(coords) { function ringArea(coords) { var p1, p2, p3, lowerIndex, middleIndex, upperIndex, i, area = 0, - coordsLength = coords.length; + coordsLength = coords.length - 1; if (coordsLength > 2) { for (i = 0; i < coordsLength; i++) { @@ -86,4 +86,4 @@ function ringArea(coords) { function rad(_) { return _ * Math.PI / 180; -} \ No newline at end of file +}