Пример #1
0
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;
}
Пример #2
0
line_segment<double,3> Sector::sector_to_clas(const line_segment<double,3>& l) const
{
    return line_segment<double,3>{
        this->sector_to_clas(l.point()),
        this->sector_to_clas(l.direction()) };
}