@Override
    public boolean contains(int x, int y) {
        
        x = x - centersdeviation;
        y = y - centersdeviation;
        
        double a = Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));
        double b = Math.sqrt((x - x2) * (x - x2) + (y - y2) * (y - y2));
        
        double c = Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
        
        //System.out.println("[ " + x + " " + y + " ]");
        
        double area = (1 / 4.0) * Math.sqrt((a + b + c) * (a + c - b) * 
                (a + b - c) * (b + c - a));
        
        double h = 2 * area / c;
        
        //System.out.println("h = " + h);
        
        return (h <= SELECT_RADIUS) && 
                (x < Math.max(x1, x2) + SELECT_RADIUS) && (y < Math.max(y1, y2) + SELECT_RADIUS) &&
                (x > Math.min(x1, x2) - SELECT_RADIUS) && (y > Math.min(y1, y2) - SELECT_RADIUS);
    }