Beispiel #1
0
 public void Check(HorizontalLine x, VerticalLine y)
 {
     if (x.IsHit(y) == true)
     {
         Console.WriteLine("Линии пересекаются");
     }
     else
     {
         Console.WriteLine("Линии не пересекаются");
     }
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            Checks check = new Checks();

            Point p = new Point(62, 2, '*');

            p.Draw();
            Point p2 = new Point(p);

            p2.Draw();

            Console.SetCursorPosition(55, 7);
            check.Check(p, p2);


            Point p3 = new Point(80, 2, '*');

            p3.Draw();
            Point p4 = new Point(85, 4, '*');

            p4.Draw();

            Console.SetCursorPosition(75, 7);
            check.Check(p3, p4);


            HorizontalLine h1 = new HorizontalLine(1, 10, 2, '*');

            h1.Draw();
            VerticalLine v1 = new VerticalLine(1, 5, 12, '*');

            v1.Draw();

            Console.SetCursorPosition(1, 7);
            check.Check(h1, v1);


            HorizontalLine h2 = new HorizontalLine(35, 45, 2, '*');

            h2.Draw();
            VerticalLine v2 = new VerticalLine(1, 5, 40, '*');

            v2.Draw();

            Console.SetCursorPosition(30, 7);
            check.Check(h2, v2);

            Console.ReadKey();
        }