Esempio n. 1
0
        static void Main(string[] args)
        {
            //Точка
            Console.WriteLine("Введите координаты точки: ");
            int x = int.Parse(Console.ReadLine());
            int y = int.Parse(Console.ReadLine());
            MyPoint point = new MyPoint(x, y);
            //Окружность
            #region
            Console.WriteLine("Введите координаты окружности: ");
            int x1 = int.Parse(Console.ReadLine());
            int y1 = int.Parse(Console.ReadLine());

            Console.WriteLine("Введите радиус: ");
            int r = int.Parse(Console.ReadLine());

            Circle circle = new Circle(new MyPoint(x1, y1), r);
            Console.WriteLine(circle.isCollide(point).ToString());
            #endregion

            //Полигон
            Console.WriteLine("Введите количество вершин: ");
            //Polygon polygon = new Polygon(int.Parse(Console.ReadLine()));
            //Console.WriteLine(polygon.isCollide(polygon, point).ToString());
            Console.ReadKey();
        }
Esempio n. 2
0
 // Кнопка подтверждения создания окружности
 private void button1_Click(object sender, EventArgs e)
 {
     // Задание точки центра окружности
     string[] s = CircleCentre.Text.Split(',');
     int x1 = int.Parse(s[0]);
     int y1 = int.Parse(s[1]);
     MyPoint p = new MyPoint(x1, y1);
     int r = int.Parse(Radius.Text);                     // Задание радиуса
     // Создание точки для проверки
     string[] pointStr = PointBox.Text.Split(',');
     int x = int.Parse(pointStr[0]);
     int y = int.Parse(pointStr[1]);
     MyPoint point = new MyPoint(x, y);
     Circle circle = new Circle(p, r);                   // Создание окружности соответсвующей введенным данным
     f1.Result.Text = circle.isCollide(point).ToString();// Вывод результата
 }