import inLine from './line';
export default function inPolyline(points, lineWidth, x, y, isClose) {
    var count = points.length;
    if (count < 2) {
        return false;
    }
    for (var i = 0; i < count - 1; i++) {
        var x1 = points[i][0];
        var y1 = points[i][1];
        var x2 = points[i + 1][0];
        var y2 = points[i + 1][1];
        if (inLine(x1, y1, x2, y2, lineWidth, x, y)) {
            return true;
        }
    }
    // 如果封闭，则计算起始点和结束点的边
    if (isClose) {
        var first = points[0];
        var last = points[count - 1];
        if (inLine(first[0], first[1], last[0], last[1], lineWidth, x, y)) {
            return true;
        }
    }
    return false;
}
//# sourceMappingURL=polyline.js.map