private void addCornerEdges(final double x, final double y, final double max_y) {
        double cur_y = y;
        double min_dist = Double.MAX_VALUE;

        // make a vertical line from the start corner to the closest region or the end corner
        for (int i = 0; i < allEdges.size(); i++) {
            GraphEdge edge = allEdges.get(i);

            if (edge.x1 == x) {
                double dist = Math.abs(edge.y1 - y);
                if (dist < min_dist) {
                    min_dist = dist;
                    cur_y = edge.y1;
                }
            }
            if (edge.x2 == x) {
                double dist = Math.abs(edge.y2 - y);
                if (dist < min_dist) {
                    min_dist = dist;
                    cur_y = edge.y2;
                }
            }
        }
        if (cur_y == y)
            cur_y = max_y;


        // find the closest site from the center of the line
        GraphEdge edge = new GraphEdge();
        edge.x1 = x;
        edge.y1 = y;
        edge.x2 = x;
        edge.y2 = cur_y;

        min_dist = Double.MAX_VALUE;
        int index = 0;
        double y_center = (edge.y2+edge.y1)/2;
        for (Site site : sites) {
            double dist = Math.sqrt(Math.pow(site.coord.x - x, 2) + Math.pow(site.coord.y - y_center, 2));
            if (dist < min_dist) {
                min_dist = dist;
                index = site.sitenbr;
            }
        }

        edge.site1 = index;
        edge.site2 = index;

        allEdges.add(edge);
    }
@param xValuesIn Array of X values for each site.
@param yValuesIn Array of Y values for each site. Must be identical length to yValuesIn
@param minX The minimum X of the bounding box around the voronoi
@param maxX The maximum X of the bounding box around the voronoi
@param minY The minimum Y of the bounding box around the voronoi
@param maxY The maximum Y of the bounding box around the voronoi
vorolay/src/main/java/quatja/com/vorolay/diagram/Voronoi.java