/// <summary> /// Determines if this ray intersect another <paramref name="segment"/>. /// </summary> /// <param name="segment">A segment.</param> /// <returns><c>true</c> when another object intersects this object.</returns> public bool Intersects(Segment2 segment) { return(Intersection(segment) != null); // TODO: optimize }
/// <summary> /// Calculates the intersection geometry between this segment and another. /// </summary> /// <param name="segment">The segment to find the intersection with.</param> /// <returns>The intersection geometry or <c>null</c> for no intersection.</returns> public IPlanarGeometry Intersection(Segment2 segment) { return(segment == null ? null : Intersection(A, B, segment.A, segment.B)); }
/// <inheritdoc/> public bool Equals(Segment2 other) { return(!ReferenceEquals(null, other) && A.Equals(other.A) && B.Equals(other.B)); }
/// <summary> /// Determines if this segment intersect another <paramref name="segment"/>. /// </summary> /// <param name="segment">A segment.</param> /// <returns><c>true</c> when another object intersects this object.</returns> public bool Intersects(Segment2 segment) { return(segment != null && Intersects(A, B, segment.A, segment.B)); }
/// <inheritdoc/> public bool Intersects(Segment2 other) { return(!ReferenceEquals(null, other) && Count > 0 && this.Any(other.Intersects)); }