Exemplo n.º 1
0
 /// <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
 }
Exemplo n.º 2
0
 /// <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));
 }
Exemplo n.º 3
0
 /// <inheritdoc/>
 public bool Equals(Segment2 other)
 {
     return(!ReferenceEquals(null, other) &&
            A.Equals(other.A) &&
            B.Equals(other.B));
 }
Exemplo n.º 4
0
 /// <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));
 }
Exemplo n.º 5
0
 /// <inheritdoc/>
 public bool Intersects(Segment2 other)
 {
     return(!ReferenceEquals(null, other) &&
            Count > 0 &&
            this.Any(other.Intersects));
 }