Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }