function segmentsOverlap(a1, a2, b1, b2)
        {
            console.assert(a1 <= a2 && b1 <= b2, "segments should be specified as ordered pairs");
            return a2 > b1 && a1 < b2;
        }
@param {number} a1
@param {number} a2
@param {number} b1
@param {number} b2
@return {boolean}