public boolean crossedWall(double x, double dx, double y, double dy){
        if (x1 == x2){
            return inSection(x, x1, x2, y, y1, y2) && (x-x1)*(x1-x-dx)>0;
        }
        if ( y1 == y2) {
            return inSection(x, x1, x2, y, y1, y2) && (y-y1)*(y1-y-dy)>0;
        }
        double k = (y1 - y2)/(x1 - x2);
        double b = y1 - k * x1;
        double b1 = (y + dy) - k * (x + dx);
        double b2 = y - k * x;
        return (((b - b1)*(b - b2) <= 0) && inSection(x, x1, x2, y, y1, y2));
    }