示例#1
0
 /*_________________________________________________________Конструкторы_класса_____________________________________________________________*/
 #region Constructors of class
 public IncisionOf3DJulia(Quaternion Rotater = null, ulong IterationsCount = 40UL, double LeftEdge = -1.5D, double RightEdge = 1.5D, double TopEdge = -1.1D, double BottomEdge = 1.1D, Triplex Const = null)
 {
     f_iterations_count = IterationsCount;
     _2df_left_edge     = LeftEdge;
     _2df_right_edge    = RightEdge;
     _2df_top_edge      = TopEdge;
     _2df_bottom_edge   = BottomEdge;
     f_number_of_using_threads_for_parallel = Environment.ProcessorCount;
     if (Const == null)
     {
         inc_const = new Triplex();
     }
     else
     {
         inc_const = (Triplex)Const.Clone();
     }
     if (Rotater == null)
     {
         inc_rotater = Quaternion.Null;
     }
     else if (Rotater.Radian == 0D)
     {
         inc_rotater = Quaternion.Null;
     }
     else if (Rotater is Quaternion.QuaternionNull)
     {
         inc_rotater = Quaternion.Null;
     }
     else
     {
         inc_rotater = (Quaternion)Rotater.Clone();
     }
     f_allow_change_iterations_count();
 }
示例#2
0
        protected virtual void inc_create_part_of_fractal(AbcissOrdinateHandler p_aoh, _2DFractalHelper fractal_helper)
        {
            ulong iter_count = f_iterations_count, iteration;

            ulong[][] matrix = fractal_helper.CommonMatrix;
            double[]  abciss_points = fractal_helper.AbcissRealValues, ordinate_points = fractal_helper.OrdinateRealValues;
            double    abciss_point, dist, pdist = 0D;

            double[][] Ratio_matrix = (double[][])fractal_helper.GetRatioMatrix();
            int        percent_length = fractal_helper.PercentLength, current_percent = percent_length;

            double[][] Radian_matrix = ((RadianMatrix)fractal_helper.GetUnique(typeof(RadianMatrix))).Matrix;
            int        height = ordinate_points.Length;
            double     cosrad = Math.Cos(inc_rotater.Radian), sinrad = Math.Sin(inc_rotater.Radian);
            Triplex    z = new Triplex(), z0 = (Triplex)inc_const.Clone(), last_valid_z = new Triplex();

            inc_rotater.Rotate(z0);
            for (; p_aoh.abciss < p_aoh.end_of_abciss; p_aoh.abciss++)
            {
                abciss_point = abciss_points[p_aoh.abciss];
                Radian_matrix[p_aoh.abciss] = new double[height];
                for (; p_aoh.ordinate < p_aoh.end_of_ordinate; ++p_aoh.ordinate)
                {
                    z.x = abciss_point;
                    z.y = ordinate_points[p_aoh.ordinate];
                    z.z = 0;
                    inc_rotater.Rotate(z);
                    dist = 0D;
                    for (iteration = 0; iteration < iter_count && dist < 4D; iteration++)
                    {
                        pdist          = dist;
                        last_valid_z.x = z.x;
                        last_valid_z.y = z.y;
                        last_valid_z.z = z.z;
                        z.tsqr();
                        z.tadd(z0);
                        dist = (z.x * z.x + z.y * z.y + z.z * z.z);
                    }
                    Ratio_matrix[p_aoh.abciss][p_aoh.ordinate]  = pdist;
                    matrix[p_aoh.abciss][p_aoh.ordinate]        = iteration;
                    Radian_matrix[p_aoh.abciss][p_aoh.ordinate] = Math.Atan2(last_valid_z.y, last_valid_z.x) * cosrad + sinrad * Math.Atan2(last_valid_z.z, last_valid_z.x);
                }
                p_aoh.ordinate = 0;
                if ((--current_percent) == 0)
                {
                    current_percent = percent_length;
                    f_new_percent_in_parallel_activate();
                }
            }
        }