diff --git a/include/boost/geometry/policies/relate/intersection_ratios.hpp b/include/boost/geometry/policies/relate/intersection_ratios.hpp index 0e4506eda..81ecba0b5 100644 --- a/include/boost/geometry/policies/relate/intersection_ratios.hpp +++ b/include/boost/geometry/policies/relate/intersection_ratios.hpp @@ -99,6 +99,24 @@ struct segments_intersection_ratios { return return_type(); } + + template + static inline return_type one_degenerate(Segment const& , + Ratio const& ratio, bool a_degenerate) + { + return_type result; + if (a_degenerate) + { + // IP lies on ratio w.r.t. segment b + result.assign(Ratio::zero(), ratio); + } + else + { + result.assign(ratio, Ratio::zero()); + } + return result; + } + };