Example #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ls"></param>
 public void SetCoordinates(LineSegment ls)
 {
     SetCoordinates(ls._p0, ls._p1);
 }
Example #2
0
 /// <summary>
 /// Creates an instance of this class using another instance
 /// </summary>
 /// <param name="ls"></param>
 public LineSegment(LineSegment ls) : this(ls._p0, ls._p1)
 {
 }
Example #3
0
 /// <summary>
 /// Returns <c>true</c> if <c>other</c> is
 /// topologically equal to this LineSegment (e.g. irrespective
 /// of orientation).
 /// </summary>
 /// <param name="other">
 /// A <c>LineSegment</c> with which to do the comparison.
 /// </param>
 /// <returns>
 /// <c>true</c> if <c>other</c> is a <c>LineSegment</c>
 /// with the same values for the x and y ordinates.
 /// </returns>
 public bool EqualsTopologically(LineSegment other)
 {
     return(_p0.Equals(other._p0) && _p1.Equals(other._p1) ||
            _p0.Equals(other._p1) && _p1.Equals(other._p0));
 }
Example #4
0
 /// <summary>
 /// Computes the distance between this line segment and another one.
 /// </summary>
 /// <param name="ls"></param>
 /// <returns></returns>
 public double Distance(LineSegment ls)
 {
     return(DistanceComputer.SegmentToSegment(_p0, _p1, ls._p0, ls._p1));
 }