private Point GetIntersection(IShapeEquation shape) { Point[] intersections = shape.FindIntersections(this); Point chosenIntersection = intersections[0]; foreach (Point intersection in intersections) { bool isInBoundary = intersection.IsInBoundaryInclusively(LeftMostShape.Centre, RightMostShape.Centre, LowestShape.Centre, HighestShape.Centre); if (isInBoundary) { chosenIntersection = intersection; break; } } return(chosenIntersection); }
private Point GetIntersection(IShapeEquation shape) { Point[] intersections = shape.FindIntersections(this); Point chosenIntersection = intersections[0]; foreach (Point intersection in intersections) { bool isInBoundary = intersection.IsInBoundaryInclusively(LeftMostShape.Centre, RightMostShape.Centre, LowestShape.Centre, HighestShape.Centre); if (isInBoundary) { chosenIntersection = intersection; break; } } return chosenIntersection; }