/*_________________________________________________________Конструкторы_класса_____________________________________________________________*/ #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(); }
void IUsingComplex.SetComplex(Complex Complex) { if (Complex == null) { throw new ArgumentNullException(); } inc_const = Complex; }
public virtual void Rotate(Triplex arg) { double[] vec = new double[] { arg.x, arg.y, arg.z }; vec = Rotate(vec); arg.x = vec[0]; arg.y = vec[1]; arg.z = vec[2]; }
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 = new Triplex(), last_valid_z = new Triplex(); //new Complex(-0.8D, 0.156D)); 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) { z0.x = abciss_point; //-0.8D; z0.y = ordinate_points[p_aoh.ordinate]; //0.156D;// z0.z = 0D; inc_rotater.Rotate(z0); z.x = z0.x; z.y = z0.y; z.z = z0.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(); } } }
public override void Rotate(Triplex arg) { }
public void tadd(Triplex arg) { x += arg.x; y += arg.y; z += arg.z; }