Пример #1
0
        public override Sink Locate(Edge edge)
        {
            if (_edge.IsAbove(edge.P))
            {
                // Move down the graph
                return(RightChild.Locate(edge));
            }

            if (_edge.IsBelow(edge.P))
            {
                // Move up the graph
                return(LeftChild.Locate(edge));
            }

            // s and segment share the same endpoint, p
            if (edge.Slope < _edge.Slope)
            {
                // Move down the graph
                return(RightChild.Locate(edge));
            }

            // Move up the graph
            return(LeftChild.Locate(edge));
        }
Пример #2
0
 // Determines if this point lies inside the trapezoid
 public bool Contains(Point point)
 {
     return(point.X > LeftPoint.X && point.X < RightPoint.X && Top.IsAbove(point) && Bottom.IsBelow(point));
 }