bool is_disjoint(const line_segment& l, const line_segment& m) { if (l == m) { return false; } //std::cerr << l.direction() << ", " << m.direction() << std::endl; if (l.direction() == m.direction() || l.opposite().direction() == m.direction()) { //std::cerr << l.has_on(m.source()) << l.has_on(m.target()); if (l.has_on(m.source())) { if (l.source() != m.source() && l.target() != m.source()) { return false; } } else if (l.has_on(m.target())) { if (l.source() != m.target() && l.target() != m.target()) { return false; } } } else { return true; } return true; }
std::string line_segment_to_string(const line_segment& l) { std::stringstream s; s << point_to_string(l.source()) << " " << point_to_string(l.target()); return s.str(); }