//---------------------------------------------------------------------------------------------
        //---------------------------------------------------------------------------------------------
        //Вычисление матрицы фаз
        private RealMatrix CalculatePhaseMatrixByCirclePoints(
            Point3D[] circlePoints, Point[] imagePoints, int sizeX, int sizeY
            )
        {
            bool sizeEuqality = ArrayOperator.IsArraySizesEqual(circlePoints, imagePoints);

            if (!sizeEuqality)
            {
                throw new Exception();
            }
            ThreePointInterferogramDecoder decoder = new ThreePointInterferogramDecoder();

            double[] phaseShifts = this.GetPhaseShifts();

            RealMatrix phaseMatrix = new RealMatrix(sizeY, sizeX, this.DefaultPhaseValue);

            for (int index = 0; index < circlePoints.Length; index++)
            {
                Point3D  point       = circlePoints[index];
                Point    imagePoint  = imagePoints[index];
                double[] intensities = new double[] { point.X, point.Y, point.Z };

                double phase = decoder.Decode(intensities, phaseShifts);
                //double phase = 2 * Math.PI - decoder.Decode( intensities, phaseShifts );

                phaseMatrix[imagePoint.Y, imagePoint.X] = phase;
            }
            return(phaseMatrix);
        }
        //---------------------------------------------------------------------------------------------
        //---------------------------------------------------------------------------------------------
        //Вычисление матрицы фаз
        private RealMatrix CalculatePhaseMatrix(
            Point2D[] points, Point[] imagePoints,
            int sizeX, int sizeY
            )
        {
            bool sizeEuqality = ArrayOperator.IsArraySizesEqual(points, imagePoints);

            if (!sizeEuqality)
            {
                throw new Exception();
            }
            RealMatrix phaseMatrix = new RealMatrix(sizeY, sizeX, this.DefaultPhaseValue);

            for (int index = 0; index < points.Length; index++)
            {
                Point2D point      = points[index];
                Point   imagePoint = imagePoints[index];
                double  phase      = this.CalculatePhase(point.X, point.Y);
                phaseMatrix[imagePoint.Y, imagePoint.X] = phase;
            }
            return(phaseMatrix);
        }