public Vector findPointForWall(double x, double y){
        double xRes = -1, yRes = -1,r = 100000;
        for (Wall wall:walls){

            if (sqrt((x - wall.getX1()) * (x - wall.getX1()) + (y - wall.getY1()) * (y - wall.getY1())) < RADIUS_TO_DETECT_WALL_POINT &&
                    r > sqrt((x - wall.getX1()) * (x - wall.getX1()) + (y - wall.getY1()) * (y - wall.getY1()))){
                r = sqrt((x - wall.getX1()) * (x - wall.getX1()) + (y - wall.getY1()) * (y - wall.getY1()));
                xRes = wall.getX1();
                yRes = wall.getY1();
            }
            if (sqrt((x - wall.getX2()) * (x - wall.getX2()) + (y - wall.getY2()) * (y - wall.getY2())) < RADIUS_TO_DETECT_WALL_POINT &&
                    r > sqrt((x - wall.getX2()) * (x - wall.getX2()) + (y - wall.getY2()) * (y - wall.getY2()))){
                xRes = wall.getX2();
                yRes = wall.getY2();
            }
        }
        if (xRes != -1){
            return new Vector(xRes, yRes);
        }
        return null;
    }