public static double Overlap(this EdgeModel firstEdge, EdgeModel secondEdge) { if (firstEdge is null) { throw new ArgumentNullException(nameof(firstEdge)); } if (secondEdge is null) { throw new ArgumentNullException(nameof(secondEdge)); } return(Math.Max(0, firstEdge.Difference(secondEdge))); }
public static bool Collision(this EdgeModel firstEdge, EdgeModel secondEdge) { if (firstEdge is null) { throw new ArgumentNullException(nameof(firstEdge)); } if (secondEdge is null) { throw new ArgumentNullException(nameof(secondEdge)); } return(firstEdge.Difference(secondEdge) >= 0); }