private Locus <T> CombineIntersections(PointLocus <T> current, MultiPointLocus <T> addition) { if (!ContainsPoint(addition, current)) { addition.Points.Add(current.IntersectionPoint); } return(addition); }
private Locus <T> CombineIntersections(MultiPointLocus <T> current, PointLocus <T> addition) { if (!ContainsPoint(current, addition)) { current.Points.Add(addition.IntersectionPoint); } return(current); }
private Locus <T> CombineIntersections(PointLocus <T> current, PointLocus <T> addition) { if (current.Equals(addition)) { return(current); } return(new MultiPointLocus <T>(current.IntersectionPoint, addition.IntersectionPoint)); }
private Locus <T> CombineIntersections(PointLocus <T> current, LineSegmentLocus <T> addition) { if (ContainsPoint(addition, current)) { return(addition); } addition.Segments.Add(new Line2D <T>(current.IntersectionPoint, current.IntersectionPoint)); return(addition); }
private bool ContainsPoint(MultiPointLocus <T> multi, PointLocus <T> point) { foreach (Point2D <T> p2 in multi.Points) { if (p2.Equals(point.IntersectionPoint)) { return(true); } } return(false); }
/// <summary> /// Determine if the point is contained in any of the segments of the line segment /// </summary> /// <param name="lineSegment"></param> /// <param name="point"></param> /// <returns>true if the point lands on a line segment</returns> private bool ContainsPoint(LineSegmentLocus <T> lineSegment, PointLocus <T> point) { foreach (Line2D <T> line in lineSegment.Segments) { if (line.Contains(point.IntersectionPoint)) { return(true); } } return(false); }
private Locus <T> CombineIntersections(LineSegmentLocus <T> current, PointLocus <T> addition) { // If the point to be added already exists in one of the line // segments ignore it if (ContainsPoint(current, addition)) { return(current); } current.Segments.Add(new Line2D <T>(addition.IntersectionPoint, addition.IntersectionPoint)); return(current); }
private Locus <T> CombineIntersections(EmptyLocus <T> current, PointLocus <T> addition) { return(addition); }