/// <summary> /// Returns true if this wedge contains point <paramref name='b'/>, including if <paramref name='b'/> lies on one of this wedge's edges. /// </summary> public bool Contains(WPoint b) { double distance = Circle.Center.Distance(b); if (distance > Circle.Radius) { return(false); } double degrees = Circle.DegreesAtPoint(b); return(Degrees.Overlaps(degrees)); }
/// <summary> /// Returns true if the arc overlaps any part of the <paramref name='lineSegment'/>. /// </summary> public bool ArcOverlaps(WLineSegment lineSegment) { //find intersection points between full circle and line segment WPoint[] fullCircleIntersections = Circle.GetIntersectionPoints(lineSegment); if (fullCircleIntersections == null) { return(false); } //find degrees from circle center to intersection points //are any of those degrees within the wedge degree range? foreach (WPoint point in fullCircleIntersections) { double degrees = Circle.DegreesAtPoint(point); if (Degrees.Overlaps(degrees)) { return(true); } } return(false); }