public boolean xInInterval(int l, int r) {
        int lx = this.lefterVertex().centerX();
        int rx = this.righterVertex().centerX();
        //If either of my endpoints have x in the interval,
        //then so do I.
        if(lx > l && lx < r) return true;
        if(rx > l && rx < r) return true;
        //If both my endpoints are outside the interval, part of me is
        //inside it.
        if(lx < l && rx > r) return true;
        //Otherwise, I'm off to one side.
        return false;
    }