Tag: 交叉点

C#:端点为空(无穷大)时的范围交集

好的,我有这些交集方法来处理范围,只要范围端点不为null,它们就可以正常工作: public static bool Intersects(this Range first, Range second, IComparer comparer) { return comparer.Compare(first.Start, second.End) = 0; } public static Range GetIntersectionWith(this Range first, Range second, IComparer comparer) { // Return null, if any range is null or if they don’t intersect at all if (first == null || second == null || !Intersects(first, second, […]