mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-17 13:52:09 +00:00
[intersection] fix segments_intersection_ratios
adding the new one_degenerate method
This commit is contained in:
@@ -99,6 +99,24 @@ struct segments_intersection_ratios
|
||||
{
|
||||
return return_type();
|
||||
}
|
||||
|
||||
template <typename Segment, typename Ratio>
|
||||
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;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user