/// <summary>
 /// This circle entirely contains circle B, or B entirely contains this circle, or they exactly overlap.
 /// </summary>
 public bool ContainsOrIsContained(Circle b)
 {
     if (this.Radius > b.Radius)
     {
         return(this.Contains(b));
     }
     return(b.Contains(this));
 }
Exemple #2
0
        /// <summary>
        /// Any part of this wedge overlaps any part of circle B.
        /// </summary>
        public bool Overlaps(Circle b)
        {
            Wedge a = this;

            Point[] intersections = a.Circle.GetIntersectionPoints(b);
            if (intersections == null)
            {
                if (!a.Circle.ContainsOrIsContained(b))
                {
                    return(false);
                }
            }

            //line edge overlaps circle
            foreach (LineSegment lineA in this.LineEdges)
            {
                if (b.Overlaps(lineA))
                {
                    return(true);
                }
            }
            //arc overlaps circle
            if (a.ArcOverlapsArc(new Wedge(b, 0, Circle.DEGREES_IN_CIRCLE)))
            {
                return(true);
            }
            //wedge entirely contains circle or circle entirely contains wedge
            if (a.Contains(b))
            {
                return(true);
            }
            if (b.Contains(a))
            {
                return(true);
            }

            return(false);
        }