예제 #1
0
        /// <summary>
        /// Determine the intersection of a line with this rectangle
        /// <para>If the line is contained within the rectangle it is not considered intersecting</para>
        /// </summary>
        /// <param name="line"></param>
        /// <returns></returns>
        public Locus <T> Intersection(Line2D <T> line)
        {
            Locus <T> result = new EmptyLocus <T>();

            foreach (Line2D <T> vertice in Vertices)
            {
                Locus <T> verticeIntersection = line.Intersection(vertice);
                if (!(verticeIntersection is EmptyLocus <T>))
                {
                    result = CombineIntersections((dynamic)result, (dynamic)verticeIntersection);
                }
            }
            return(result);
        }
예제 #2
0
 private Locus <T> CombineIntersections(EmptyLocus <T> current, MultiPointLocus <T> addition)
 {
     return(addition);
 }
예제 #3
0
 private Locus <T> CombineIntersections(EmptyLocus <T> current, LineSegmentLocus <T> addition)
 {
     return(addition);
 }