示例#1
0
        public void TestMethod1()
        {
            Line l1 = new Line();
            Line l2 = new Line();

            l1.a = new Point(1, 1);

            l1.b = new Point(2, 2);

            l2.a = new Point(1, 2);

            l2.b = new Point(2, 1);

            Point       p = new Point(1.5, 1.5);
            CalcOfPoint w = new CalcOfPoint();

            Assert.AreEqual(w.Back(l1, l2), p);
        }
        static void Main(string[] args)
        {
            Line first  = new Line();
            Line second = new Line();

            Console.WriteLine("Введите координаты точек первой линии");
            first.init();
            Console.WriteLine("Введите координаты точек второй линии");
            second.init();
            CalcOfPoint c = new CalcOfPoint();
            Point       q;

            q = c.Back(first, second);
            Console.Write("x=");
            Console.WriteLine(q.x);
            Console.Write("y=");
            Console.WriteLine(q.y);
            Console.ReadKey();
        }