예제 #1
0
        float DpDz(Potential pot1, Potential pot2, Potential pot3)
        {
            float C = (pot2.point.X - pot1.point.X) * (pot3.point.Y - pot1.point.Y) -
                      (pot3.point.X - pot1.point.X) * (pot2.point.Y - pot1.point.Y);

            return(C);
        }
예제 #2
0
        float DpDx(Potential pot1, Potential pot2, Potential pot3)
        {
            float A = (pot2.point.Y - pot1.point.Y) * (pot3.value - pot1.value) -
                      (pot3.point.Y - pot1.point.Y) * (pot2.value - pot1.value);

            return(A);
        }
예제 #3
0
        float DpDy(Potential pot1, Potential pot2, Potential pot3)
        {
            float B = -((pot2.point.X - pot1.point.X) * (pot3.value - pot1.value) -
                        (pot3.point.X - pot1.point.X) * (pot2.value - pot1.value));

            return(B);
        }
예제 #4
0
        public void CalculatePotential()
        {
            StreamWriter streamA = new StreamWriter("A.txt");
            StreamWriter streamB = new StreamWriter("B.txt");
            StreamWriter streamC = new StreamWriter("C.txt");

            CreateMatrixA();
            CreateB();
            C.Clear();
            List <float> buf = new List <float>();

            float[] a = new float[A.Count * A.Count];
            float[] b = new float[B.Count];
            for (int i = 0; i < A.Count; i++)
            {
                buf.AddRange(A[i]);
                for (int j = 0; j < A[i].Count; j++)
                {
                    streamA.Write(A[i][j] + "  ");
                }
                streamA.WriteLine();
            }
            a = buf.ToArray();
            for (int i = 0; i < B.Count; i++)
            {
                streamB.WriteLine(B[i]);
            }
            b = B.ToArray();
            C.AddRange(MethodKachmarzh(a, b, B.Count, B.Count));
            for (int i = 0; i < C.Count; i++)
            {
                streamC.WriteLine(C[i]);
            }

            streamA.Close();
            streamB.Close();
            streamC.Close();
            List <Potential> newPotential = new List <Potential>();

            for (int i = 0; i < unknownPotential.Count; i++)
            {
                Potential pot = new Potential {
                    point = unknownPotential[i].point, value = C[i]
                };
                newPotential.Add(pot);
            }
            unknownPotential.Clear();
            unknownPotential.AddRange(newPotential);
        }
예제 #5
0
        public List <Triangle> AddPoint(PointF point)
        {
            if (!IsInMagnets(point))
            {
                Potential pot = new Potential {
                    point = point, value = 0
                };
                unknownPotential.Add(pot);

                List <PointF> newPoints = new List <PointF>();
                newPoints.Add(point);
                int numDeleting = 0;
                while (numDeleting < list_triangle.Count)
                {
                    bool detected = false;
                    numDeleting = 0;
                    int size_triangle = list_triangle.Count;
                    for (int i = 0; i < size_triangle; i++)
                    {
                        Triangle triangle   = list_triangle[i];
                        bool     IsInMagnet = false;
                        foreach (PointF bufPoint in FakePoints)
                        {
                            if ((triangle.point1 == bufPoint) ||
                                (triangle.point2 == bufPoint) ||
                                (triangle.point3 == bufPoint))
                            {
                                IsInMagnet = true; break;
                            }
                        }
                        if (!IsInMagnet)
                        {
                            ParametrsEllipse param = new ParametrsEllipse();
                            param = SearchEllipse(triangle);

                            float distance = (float)Math.Sqrt((point.X - param.center.X) * (point.X - param.center.X) +
                                                              (point.Y - param.center.Y) * (point.Y - param.center.Y));
                            if (distance < param.R && param.R < 1e+6)
                            {
                                bool new1 = true, new2 = true, new3 = true;
                                foreach (PointF bufPoint in newPoints)
                                {
                                    if (triangle.point1 == bufPoint)
                                    {
                                        new1 = false;
                                    }
                                    if (triangle.point2 == bufPoint)
                                    {
                                        new2 = false;
                                    }
                                    if (triangle.point3 == bufPoint)
                                    {
                                        new3 = false;
                                    }
                                }


                                if (new1)
                                {
                                    newPoints.Add(triangle.point1);
                                }
                                if (new2)
                                {
                                    newPoints.Add(triangle.point2);
                                }
                                if (new3)
                                {
                                    newPoints.Add(triangle.point3);
                                }
                                detected = true;

                                break;
                            }
                        }
                        numDeleting++;
                    }
                    if (detected)
                    {
                        list_triangle.RemoveAt(numDeleting);
                    }
                }

                List <Triangle> buffer_list2 = new List <Triangle>();
                buffer_list2.AddRange(ReturnAllTriangles(newPoints));

                numDeleting = 0;
                while (numDeleting < buffer_list2.Count)
                {
                    bool detected = false;
                    numDeleting = 0;
                    foreach (Triangle triangle in buffer_list2)
                    {
                        if (!((triangle.point1 == point) || (triangle.point2 == point) || (triangle.point3 == point)))
                        {
                            detected = true;
                            break;
                        }
                        numDeleting++;
                    }
                    if (detected)
                    {
                        buffer_list2.RemoveAt(numDeleting);
                    }
                }
                return(UpdateListTriangle(buffer_list2));
            }
            else
            {
                return(list_triangle);
            }
        }
예제 #6
0
        public List <LevelLines> GetLevelLines()
        {
            levelLines.Clear();
            foreach (float level in levels)
            {
                foreach (TrianglePotential triangle in triangles)
                {
                    Potential pot1 = new Potential();
                    Potential pot2 = new Potential();
                    Potential pot3 = new Potential();

                    /*Располагаю точки по возрастанию от 1й к 3й*/
                    if (triangle.point1.value >= triangle.point2.value && triangle.point2.value > triangle.point3.value)
                    {
                        pot1 = triangle.point1;
                        pot2 = triangle.point2;
                        pot3 = triangle.point3;
                    }
                    else if (triangle.point1.value >= triangle.point3.value && triangle.point3.value > triangle.point2.value)
                    {
                        pot1 = triangle.point1;
                        pot2 = triangle.point3;
                        pot3 = triangle.point2;
                    }
                    else if (triangle.point2.value >= triangle.point1.value && triangle.point1.value > triangle.point3.value)
                    {
                        pot1 = triangle.point2;
                        pot2 = triangle.point1;
                        pot3 = triangle.point3;
                    }
                    else if (triangle.point2.value >= triangle.point3.value && triangle.point3.value > triangle.point1.value)
                    {
                        pot1 = triangle.point2;
                        pot2 = triangle.point3;
                        pot3 = triangle.point1;
                    }
                    else if (triangle.point3.value >= triangle.point2.value && triangle.point2.value > triangle.point1.value)
                    {
                        pot1 = triangle.point3;
                        pot2 = triangle.point2;
                        pot3 = triangle.point1;
                    }
                    else if (triangle.point3.value >= triangle.point1.value && triangle.point1.value > triangle.point2.value)
                    {
                        pot1 = triangle.point3;
                        pot2 = triangle.point1;
                        pot3 = triangle.point2;
                    }

                    if (level <= pot1.value && level >= pot3.value)
                    {
                        PointF point1 = new PointF();
                        PointF point2 = new PointF();
                        if (level > pot2.value)
                        {
                            point1.X = pot1.point.X -
                                       (pot1.value - level) / (pot1.value - pot2.value) * (pot1.point.X - pot2.point.X);
                            point1.Y = pot1.point.Y -
                                       (pot1.value - level) / (pot1.value - pot2.value) * (pot1.point.Y - pot2.point.Y);
                        }
                        else
                        {
                            point1.X = pot2.point.X -
                                       (pot2.value - level) / (pot2.value - pot3.value) * (pot2.point.X - pot3.point.X);
                            point1.Y = pot2.point.Y -
                                       (pot2.value - level) / (pot2.value - pot3.value) * (pot2.point.Y - pot3.point.Y);
                        }
                        point2.X = pot1.point.X -
                                   (pot1.value - level) / (pot1.value - pot3.value) * (pot1.point.X - pot3.point.X);
                        point2.Y = pot1.point.Y -
                                   (pot1.value - level) / (pot1.value - pot3.value) * (pot1.point.Y - pot3.point.Y);
                        LevelLines ll = new LevelLines {
                            point1 = point1, point2 = point2
                        };
                        levelLines.Add(ll);
                    }
                }
            }
            return(levelLines);
        }
예제 #7
0
        public List <Potential> ReturnPotential(float minU, float maxU)
        {
            potential.Clear();
            CreateDiscret();
            List <PointF> coordinates = new List <PointF>();
            int           size_points = points.Count;

            for (int i = 0; i < size_points; i++)
            {
                if (points[i].X < center.X)
                {
                    PointF newPoint = new PointF(
                        (float)(points[i].X * Math.Cos(angle) - points[i].Y * Math.Sin(angle)),
                        (float)(points[i].X * Math.Sin(angle) + points[i].Y * Math.Cos(angle))
                        );
                    Potential pot = new Potential {
                        point = newPoint, value = minU
                    };
                    potential.Add(pot);
                }
                else
                {
                    PointF newPoint = new PointF(
                        (float)(points[i].X * Math.Cos(angle) - points[i].Y * Math.Sin(angle)),
                        (float)(points[i].X * Math.Sin(angle) + points[i].Y * Math.Cos(angle))
                        );
                    Potential pot = new Potential {
                        point = newPoint, value = maxU
                    };
                    potential.Add(pot);
                }
            }
            points.Clear();

            int size_potential = potential.Count;

            for (int i = 0; i < size_potential; i++)
            {
                points.Add(potential[i].point);
            }

            PointF newPoint1 = new PointF((float)(A.X * Math.Cos(angle) - A.Y * Math.Sin(angle)),
                                          (float)(A.X * Math.Sin(angle) + A.Y * Math.Cos(angle)));

            A = newPoint1;

            PointF newPoint2 = new PointF((float)(B.X * Math.Cos(angle) - B.Y * Math.Sin(angle)),
                                          (float)(B.X * Math.Sin(angle) + B.Y * Math.Cos(angle)));

            B = newPoint2;
            PointF newPoint3 = new PointF((float)(C.X * Math.Cos(angle) - C.Y * Math.Sin(angle)),
                                          (float)(C.X * Math.Sin(angle) + C.Y * Math.Cos(angle)));

            C = newPoint3;
            PointF newPoint4 = new PointF((float)(D.X * Math.Cos(angle) - D.Y * Math.Sin(angle)),
                                          (float)(D.X * Math.Sin(angle) + D.Y * Math.Cos(angle)));

            D = newPoint4;

            return(potential);
        }
예제 #8
0
        public List <LevelLines> GetForceLines()
        {
            int size_triangles = triangles.Count;
            int size_magnet1   = magnet1.Count;
            int size_magnet2   = magnet2.Count;

            forceLines.Clear();
            for (int i = 0; i < size_magnet1; ++i)
            {
                Potential pot           = magnet1[i];
                PointF    reducentPoint = new PointF();
                reducentPoint = pot.point;


                int num_triangle                 = 0;
                TrianglePotential triangle       = new TrianglePotential();
                PointF            passPoint1     = new PointF();
                PointF            passPoint2     = new PointF();
                PointF            mainPoint      = new PointF();
                PointF            pointIntersect = new PointF(); //точка пересечения
                /*Поиск любого треугольника на границе магнита содержащего точку pot*/
                for (int j = 0; j < size_triangles; j++)
                {
                    if (pot.point == triangles[j].point1.point)
                    {
                        num_triangle = j;
                        passPoint1   = pot.point;
                        passPoint2   = triangles[j].point2.point;
                        mainPoint    = triangles[j].point3.point;
                        break;
                    }
                    if (pot.point == triangles[j].point2.point)
                    {
                        num_triangle = j;
                        passPoint1   = pot.point;
                        passPoint2   = triangles[j].point1.point;
                        mainPoint    = triangles[j].point3.point;
                        break;
                    }
                    if (pot.point == triangles[j].point3.point)
                    {
                        num_triangle = j;
                        passPoint1   = pot.point;
                        passPoint2   = triangles[j].point2.point;
                        mainPoint    = triangles[j].point1.point;
                        break;
                    }
                }
                triangle = triangles[num_triangle];

                float A = -DpDx(triangle.point1, triangle.point2, triangle.point3);
                float B = -DpDy(triangle.point1, triangle.point2, triangle.point3);

                //крайняя точка градиента
                pointIntersect.X = (passPoint1.X + passPoint2.X) / 2;
                pointIntersect.Y = (passPoint1.Y + passPoint2.Y) / 2;
                pot.point        = pointIntersect;
                PointF pot2 = new PointF {
                    X = pot.point.X + A, Y = pot.point.Y + B
                };


                LevelLines line = new LevelLines();

                PointF futureBoardPoint1 = new PointF();     //точки стороны, с которой будет пересечение градиента
                PointF futureBoardPoint2 = new PointF();



                //Пробую найти пересечение с однйо из сторон треугольника
                float ka = 0, kb = 0;
                ka = Ua(mainPoint, passPoint2, pot.point, pot2);
                kb = Ub(mainPoint, passPoint2, pot.point, pot2);
                PointF intersectBuf = new PointF();
                if (ka <= 1 && ka >= 0)
                {
                    intersectBuf.X    = mainPoint.X + ka * (passPoint2.X - mainPoint.X);
                    intersectBuf.Y    = mainPoint.Y + ka * (passPoint2.Y - mainPoint.Y);
                    futureBoardPoint1 = mainPoint;
                    futureBoardPoint2 = passPoint2;
                    reducentPoint     = passPoint1;

                    pointIntersect = intersectBuf;
                    line.point1    = pot.point;
                    line.point2    = pointIntersect;

                    forceLines.Add(line);
                }
                else
                {
                    ka = Ua(mainPoint, passPoint1, pot.point, pot2);
                    kb = Ub(mainPoint, passPoint1, pot.point, pot2);

                    if (ka <= 1 && ka >= 0)
                    {
                        intersectBuf.X    = mainPoint.X + ka * (passPoint1.X - mainPoint.X);
                        intersectBuf.Y    = mainPoint.Y + ka * (passPoint1.Y - mainPoint.Y);
                        futureBoardPoint1 = mainPoint;
                        futureBoardPoint2 = passPoint1;
                        reducentPoint     = passPoint2;

                        pointIntersect = intersectBuf;
                        line.point1    = pot.point;
                        line.point2    = pointIntersect;

                        forceLines.Add(line);
                    }
                }


                for (int z = 0; z < 200; z++)
                {
                    triangle   = new TrianglePotential();
                    passPoint1 = new PointF();
                    passPoint2 = new PointF();
                    mainPoint  = new PointF();
                    /*Поиск любого треугольника содержащего точки futureBoardPoints*/
                    for (int j = 0; j < size_triangles; j++)
                    {
                        TrianglePotential tr = new TrianglePotential();
                        tr = triangles[j];
                        if (futureBoardPoint1 == tr.point1.point && futureBoardPoint2 == tr.point2.point && reducentPoint != tr.point3.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point1.point;
                            passPoint2   = tr.point2.point;
                            mainPoint    = tr.point3.point;
                        }
                        if (futureBoardPoint1 == tr.point1.point && futureBoardPoint2 == tr.point3.point && reducentPoint != tr.point2.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point1.point;
                            passPoint2   = tr.point3.point;
                            mainPoint    = tr.point2.point;
                        }
                        if (futureBoardPoint1 == tr.point2.point && futureBoardPoint2 == tr.point1.point && reducentPoint != tr.point3.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point2.point;
                            passPoint2   = tr.point1.point;
                            mainPoint    = tr.point3.point;
                        }
                        if (futureBoardPoint1 == tr.point2.point && futureBoardPoint2 == tr.point3.point && reducentPoint != tr.point1.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point2.point;
                            passPoint2   = tr.point3.point;
                            mainPoint    = tr.point1.point;
                        }
                        if (futureBoardPoint1 == tr.point3.point && futureBoardPoint2 == tr.point2.point && reducentPoint != tr.point1.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point3.point;
                            passPoint2   = tr.point2.point;
                            mainPoint    = tr.point1.point;
                        }
                        if (futureBoardPoint1 == tr.point3.point && futureBoardPoint2 == tr.point1.point && reducentPoint != tr.point2.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point1.point;
                            passPoint2   = tr.point3.point;
                            mainPoint    = tr.point2.point;
                        }
                    }

                    triangle = triangles[num_triangle];

                    A = -DpDx(triangle.point1, triangle.point2, triangle.point3);
                    B = -DpDy(triangle.point1, triangle.point2, triangle.point3);

                    pot.point = pointIntersect;
                    pot2.X    = pot.point.X + A;
                    pot2.Y    = pot.point.Y + B;



                    //Пробую найти пересечение с однйо из сторон треугольника
                    ka           = 0; kb = 0;
                    ka           = Ua(mainPoint, passPoint2, pot.point, pot2);
                    kb           = Ub(mainPoint, passPoint2, pot.point, pot2);
                    intersectBuf = new PointF();
                    if (ka <= 1 && ka >= 0)
                    {
                        intersectBuf.X    = mainPoint.X + ka * (passPoint2.X - mainPoint.X);
                        intersectBuf.Y    = mainPoint.Y + ka * (passPoint2.Y - mainPoint.Y);
                        futureBoardPoint1 = mainPoint;
                        futureBoardPoint2 = passPoint2;
                        reducentPoint     = passPoint1;

                        pointIntersect = intersectBuf;
                        line.point1    = pot.point;
                        line.point2    = pointIntersect;

                        forceLines.Add(line);
                    }
                    else
                    {
                        ka = Ua(mainPoint, passPoint1, pot.point, pot2);
                        kb = Ub(mainPoint, passPoint1, pot.point, pot2);

                        if (ka <= 1 && ka >= 0)
                        {
                            intersectBuf.X    = mainPoint.X + ka * (passPoint1.X - mainPoint.X);
                            intersectBuf.Y    = mainPoint.Y + ka * (passPoint1.Y - mainPoint.Y);
                            futureBoardPoint1 = mainPoint;
                            futureBoardPoint2 = passPoint1;
                            reducentPoint     = passPoint2;



                            pointIntersect = intersectBuf;
                            line.point1    = pot.point;
                            line.point2    = pointIntersect;

                            forceLines.Add(line);
                        }
                    }
                }
            }
            for (int i = 0; i < size_magnet2; ++i)
            {
                Potential pot           = magnet2[i];
                PointF    reducentPoint = new PointF();
                reducentPoint = pot.point;

                // if (pot.value > 0)
                // {
                int num_triangle                 = 0;
                TrianglePotential triangle       = new TrianglePotential();
                PointF            passPoint1     = new PointF();
                PointF            passPoint2     = new PointF();
                PointF            mainPoint      = new PointF();
                PointF            pointIntersect = new PointF(); //точка пересечения
                /*Поиск любого треугольника на границе магнита содержащего точку pot*/
                for (int j = 0; j < size_triangles; j++)
                {
                    if (pot.point == triangles[j].point1.point)
                    {
                        num_triangle = j;
                        passPoint1   = pot.point;
                        passPoint2   = triangles[j].point2.point;
                        mainPoint    = triangles[j].point3.point;
                        break;
                    }
                    if (pot.point == triangles[j].point2.point)
                    {
                        num_triangle = j;
                        passPoint1   = pot.point;
                        passPoint2   = triangles[j].point1.point;
                        mainPoint    = triangles[j].point3.point;
                        break;
                    }
                    if (pot.point == triangles[j].point3.point)
                    {
                        num_triangle = j;
                        passPoint1   = pot.point;
                        passPoint2   = triangles[j].point2.point;
                        mainPoint    = triangles[j].point1.point;
                        break;
                    }
                }
                triangle = triangles[num_triangle];

                float A = -DpDx(triangle.point1, triangle.point2, triangle.point3);
                float B = -DpDy(triangle.point1, triangle.point2, triangle.point3);

                //крайняя точка градиента
                pointIntersect.X = (passPoint1.X + passPoint2.X) / 2;
                pointIntersect.Y = (passPoint1.Y + passPoint2.Y) / 2;
                pot.point        = pointIntersect;
                PointF pot2 = new PointF {
                    X = pot.point.X + A, Y = pot.point.Y + B
                };


                LevelLines line = new LevelLines();

                PointF futureBoardPoint1 = new PointF();     //точки стороны, с которой будет пересечение градиента
                PointF futureBoardPoint2 = new PointF();



                //Пробую найти пересечение с однйо из сторон треугольника
                float ka = 0, kb = 0;
                ka = Ua(mainPoint, passPoint2, pot.point, pot2);
                kb = Ub(mainPoint, passPoint2, pot.point, pot2);
                PointF intersectBuf = new PointF();
                if (ka <= 1 && ka >= 0)
                {
                    intersectBuf.X    = mainPoint.X + ka * (passPoint2.X - mainPoint.X);
                    intersectBuf.Y    = mainPoint.Y + ka * (passPoint2.Y - mainPoint.Y);
                    futureBoardPoint1 = mainPoint;
                    futureBoardPoint2 = passPoint2;
                    reducentPoint     = passPoint1;

                    pointIntersect = intersectBuf;
                    line.point1    = pot.point;
                    line.point2    = pointIntersect;

                    forceLines.Add(line);
                }
                else
                {
                    ka = Ua(mainPoint, passPoint1, pot.point, pot2);
                    kb = Ub(mainPoint, passPoint1, pot.point, pot2);

                    if (ka <= 1 && ka >= 0)
                    {
                        intersectBuf.X    = mainPoint.X + ka * (passPoint1.X - mainPoint.X);
                        intersectBuf.Y    = mainPoint.Y + ka * (passPoint1.Y - mainPoint.Y);
                        futureBoardPoint1 = mainPoint;
                        futureBoardPoint2 = passPoint1;
                        reducentPoint     = passPoint2;

                        pointIntersect = intersectBuf;
                        line.point1    = pot.point;
                        line.point2    = pointIntersect;

                        forceLines.Add(line);
                    }
                }


                for (int z = 0; z < 200; z++)
                {
                    triangle   = new TrianglePotential();
                    passPoint1 = new PointF();
                    passPoint2 = new PointF();
                    mainPoint  = new PointF();
                    /*Поиск любого треугольника содержащего точки futureBoardPoints*/
                    for (int j = 0; j < size_triangles; j++)
                    {
                        TrianglePotential tr = new TrianglePotential();
                        tr = triangles[j];
                        if (futureBoardPoint1 == tr.point1.point && futureBoardPoint2 == tr.point2.point && reducentPoint != tr.point3.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point1.point;
                            passPoint2   = tr.point2.point;
                            mainPoint    = tr.point3.point;
                        }
                        if (futureBoardPoint1 == tr.point1.point && futureBoardPoint2 == tr.point3.point && reducentPoint != tr.point2.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point1.point;
                            passPoint2   = tr.point3.point;
                            mainPoint    = tr.point2.point;
                        }
                        if (futureBoardPoint1 == tr.point2.point && futureBoardPoint2 == tr.point1.point && reducentPoint != tr.point3.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point2.point;
                            passPoint2   = tr.point1.point;
                            mainPoint    = tr.point3.point;
                        }
                        if (futureBoardPoint1 == tr.point2.point && futureBoardPoint2 == tr.point3.point && reducentPoint != tr.point1.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point2.point;
                            passPoint2   = tr.point3.point;
                            mainPoint    = tr.point1.point;
                        }
                        if (futureBoardPoint1 == tr.point3.point && futureBoardPoint2 == tr.point2.point && reducentPoint != tr.point1.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point3.point;
                            passPoint2   = tr.point2.point;
                            mainPoint    = tr.point1.point;
                        }
                        if (futureBoardPoint1 == tr.point3.point && futureBoardPoint2 == tr.point1.point && reducentPoint != tr.point2.point)
                        {
                            num_triangle = j;
                            passPoint1   = tr.point1.point;
                            passPoint2   = tr.point3.point;
                            mainPoint    = tr.point2.point;
                        }
                    }

                    triangle = triangles[num_triangle];

                    A = -DpDx(triangle.point1, triangle.point2, triangle.point3);
                    B = -DpDy(triangle.point1, triangle.point2, triangle.point3);

                    pot.point = pointIntersect;
                    pot2.X    = pot.point.X + A;
                    pot2.Y    = pot.point.Y + B;



                    //Пробую найти пересечение с однйо из сторон треугольника
                    ka           = 0; kb = 0;
                    ka           = Ua(mainPoint, passPoint2, pot.point, pot2);
                    kb           = Ub(mainPoint, passPoint2, pot.point, pot2);
                    intersectBuf = new PointF();
                    if (ka <= 1 && ka >= 0)
                    {
                        intersectBuf.X    = mainPoint.X + ka * (passPoint2.X - mainPoint.X);
                        intersectBuf.Y    = mainPoint.Y + ka * (passPoint2.Y - mainPoint.Y);
                        futureBoardPoint1 = mainPoint;
                        futureBoardPoint2 = passPoint2;
                        reducentPoint     = passPoint1;

                        pointIntersect = intersectBuf;
                        line.point1    = pot.point;
                        line.point2    = pointIntersect;

                        forceLines.Add(line);
                    }
                    else
                    {
                        ka = Ua(mainPoint, passPoint1, pot.point, pot2);
                        kb = Ub(mainPoint, passPoint1, pot.point, pot2);

                        if (ka <= 1 && ka >= 0)
                        {
                            intersectBuf.X    = mainPoint.X + ka * (passPoint1.X - mainPoint.X);
                            intersectBuf.Y    = mainPoint.Y + ka * (passPoint1.Y - mainPoint.Y);
                            futureBoardPoint1 = mainPoint;
                            futureBoardPoint2 = passPoint1;
                            reducentPoint     = passPoint2;



                            pointIntersect = intersectBuf;
                            line.point1    = pot.point;
                            line.point2    = pointIntersect;

                            forceLines.Add(line);
                        }
                    }
                }


                //  }
            }
            return(forceLines);
        }