示例#1
0
        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)));
        }
示例#2
0
        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);
        }