/// <inheritdoc/> public bool Intersects(LineString2 other) { if (Count == 0 || ReferenceEquals(null, other) || other.Count == 0) { return(false); } if (Count == 1) { return(other.Intersects(this[0])); } if (other.Count == 1) { return(Intersects(other[0])); } for (int segmentIndexA = 0; segmentIndexA < SegmentCount; segmentIndexA++) { var segmentA = GetSegment(segmentIndexA); if (other.Intersects(segmentA)) { return(true); } } return(false); }
/// <inheritdoc/> public IPlanarGeometry Intersection(LineString2 other) { if (Count == 0 || ReferenceEquals(null, other) || other.Count == 0) { return(null); } if (Count == 1) { return(other.Intersects(this[0]) ? (IPlanarGeometry)this[0] : null); } if (other.Count == 1) { return(Intersects(other[0]) ? (IPlanarGeometry)other[0] : null); } throw new NotImplementedException(); }