/// <summary> /// Compares this object with the specified object for order. /// Uses the standard lexicographic ordering for the points in the LineSegment. /// </summary> /// <param name="o"> /// The <c>LineSegment</c> with which this <c>LineSegment</c> /// is being compared. /// </param> /// <returns> /// A negative integer, zero, or a positive integer as this <c>LineSegment</c> /// is less than, equal to, or greater than the specified <c>LineSegment</c>. /// </returns> public int CompareTo(object o) { var other = (LineSegment)o; var comp0 = P0.CompareTo(other.P0); return(comp0 != 0 ? comp0 : P1.CompareTo(other.P1)); }
/// <summary> /// Compares this object with the specified object for order. /// Uses the standard lexicographic ordering for the points in the LineSegment. /// </summary> /// <param name="o"> /// The <c>LineSegment</c> with which this <c>LineSegment</c> /// is being compared. /// </param> /// <returns> /// A negative integer, zero, or a positive integer as this <c>LineSegment</c> /// is less than, equal to, or greater than the specified <c>LineSegment</c>. /// </returns> public int CompareTo(object o) { LineSegment other = (LineSegment)o; int comp0 = P0.CompareTo(other.P0); if (comp0 != 0) { return(comp0); } return(P1.CompareTo(other.P1)); }