code: function simplifyRadialDist(points, sqTolerance) {
  
      var prevPoint = points[0],
          newPoints = [prevPoint],
          point;
  
      for (var i = 1, len = points.length; i < len; i++) {
          point = points[i];
  
          if (getSqDist(point, prevPoint) > sqTolerance) {
              newPoints.push(point);
              prevPoint = point;
          }
      }
  
      if (prevPoint !== point) newPoints.push(point);
  
      return newPoints;
  }
docs: rest of the code doesn't care about point format basic distance-based simplification