var dist = Util.distance(allPoints[i].worldX, allPoints[i].worldY,
        allPoints[i + 1].worldX, allPoints[i + 1].worldY);