export function clockwise(polygon) {

    var _polygon = polygon.slice(0), sum = 0;

    _polygon.push(_polygon[0]);

    for (var i = 0; i <= polygon.length - 1; i++) {

        var j  = i + 1;
        var p1 = _polygon[i].rotated;
        var p2 = _polygon[j].rotated;

        sum += (p2.x - p1.x) * (p2.y + p1.y);
    }

    return sum < 0 ? true : false;
}

@@ -68,19 +68,20 @@
 ice(0), 
-sum
+area
  = 0;%0A%0A 
@@ -274,19 +274,20 @@
         
-sum
+area
  += (p2.
@@ -335,11 +335,12 @@
 urn 
-sum
+area
  %3C 0

change sum to area