コード例 #1
0
 public static bool operator !=(Point Point1,
                                Point Point2)
 {
     //if ((Point1.XCoordinate == Point2.XCoordinate) &&
     //    (Point1.YCoordinate == Point2.YCoordinate))
     //    return (false);
     //else
     //    return (true);
     return(!Point1.Equals(Point2));
 }
コード例 #2
0
        public bool SharesEndPoint(LineSegment line, out Point sharedPoint)
        {
            if (Point1.Equals(line.Point1) || Point1.Equals(line.Point2))
            {
                sharedPoint = Point1;
                return(true);
            }
            else if (Point2.Equals(line.Point2) || Point2.Equals(line.Point1))
            {
                sharedPoint = Point2;
                return(true);
            }

            sharedPoint = new Point(0, 0);
            return(false);
        }
コード例 #3
0
 public bool Equals(LineSegment line)
 {
     if (Point1.Equals(line.Point1))
     {
         if (Point2.Equals(line.Point2))
         {
             return(true);
         }
     }
     else if (Point1.Equals(line.Point2))
     {
         if (Point2.Equals(line.Point1))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #4
0
 public Point SharedVertex(Segment s)
 {
     if (Point1.Equals(s.Point1))
     {
         return(Point1);
     }
     if (Point1.Equals(s.Point2))
     {
         return(Point1);
     }
     if (Point2.Equals(s.Point1))
     {
         return(Point2);
     }
     if (Point2.Equals(s.Point2))
     {
         return(Point2);
     }
     return(null);
 }
コード例 #5
0
 public bool Equals(LineSegment2D other) =>
 Point1.Equals(other.Point1) && Point2.Equals(other.Point2);
コード例 #6
0
ファイル: NodeLine.cs プロジェクト: Daseka/ZoneTwo
 public bool Equals(NodeLine other)
 {
     return(Point1.Equals(other?.Point1) && Point2.Equals(other?.Point2) ||
            Point2.Equals(other?.Point1) && Point1.Equals(other?.Point2));
 }
コード例 #7
0
ファイル: Side.cs プロジェクト: WurgerZax/ConsoleApp2
 public bool Equals(Side side)
 {
     return((Point1.Equals(side.Point1) && Point2.Equals(side.Point2)) ||
            (Point1.Equals(side.Point2) && Point2.Equals(side.Point1)));
 }
コード例 #8
0
 public bool HasPoint(Point p)
 {
     return(Point1.Equals(p) || Point2.Equals(p));
 }