bool operator < (const seg &a) const {
		ld x = max(min(p.x, q.x), min(a.p.x, a.q.x));
		return get_y(x) < a.get_y(x) - eps;
	}
/** Get the ordering of the segments after the cur_x value
  * choose the extra x needed for arrangement accordingly.
  */
bool operator< (const seg & a, const seg & b) {
    return a.get_y(cur_x+1e-8) < b.get_y(cur_x+1e-8);
}