예제 #1
0
 public FloatRange IntersectionWith(FloatRange other) =>
 IsEmpty || other.IsEmpty
         ? Empty
         : new FloatRange(Start.Max(other.Start), End.Min(other.End));
예제 #2
0
 public bool Equals(FloatRange other) =>
 Start.IsAlmostEqualTo(other.Start) &&
 End.IsAlmostEqualTo(other.End);
예제 #3
0
 public bool IntersectsWith(FloatRange other) =>
 !IsEmpty && !other.IsEmpty &&
 (Start <= other.Start && End >= other.End ||
  Start >= other.Start && Start <other.End ||
                                 End> other.Start && End <= other.End);