#include #include #include using point_t = boost::geometry::model::d2::point_xy; using segment_t = boost::geometry::model::segment; int main() { segment_t e1{point_t{100, 350}, point_t{-100, 400}}; segment_t e2{point_t{0, 0}, point_t{90, 600}}; std::vector iv; boost::geometry::intersection(e1, e2, iv); assert(iv.size() == 1); const auto& v = iv[0]; bool is_within = boost::geometry::within(v, e1); std::cout << "is within? " << is_within << std::endl; is_within = boost::geometry::within(v, e2); std::cout << "is within? " << is_within << std::endl; return 0; }