当前位置: 首页>>代码示例>>C#>>正文


C# Complex.Pow方法代码示例

本文整理汇总了C#中Complex.Pow方法的典型用法代码示例。如果您正苦于以下问题:C# Complex.Pow方法的具体用法?C# Complex.Pow怎么用?C# Complex.Pow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Complex的用法示例。


在下文中一共展示了Complex.Pow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create_part_of_fractal

        private void Create_part_of_fractal(_2DFractalHelper fractal_helper,AbcissOrdinateHandler p_aoh)
        {
            ulong iterations;
            int percent_length=fractal_helper.PercentLength, current_percent=percent_length,trio_height;
            ulong[][] iter_matrix = fractal_helper.CommonMatrix;
            double[] abciss_points = fractal_helper.AbcissRealValues, ordinate_points = fractal_helper.OrdinateRealValues;
            double abciss_point,ratio,lratio;
            double[][] Ratio_matrix = fractal_helper.GetRatioMatrix();
            double[][][] trio_matrix = (double[][][])fractal_helper.GetUnique(typeof(double[][][]));
            double  v1, v2, v3, v1total, v2total, v3total, v1min, v1max, v2min, v2max, v3min, v3max;
            Complex value=new Complex(), z=new Complex();
            trio_height=Ratio_matrix[0].Length;
            for(;p_aoh.abciss<p_aoh.end_of_abciss;p_aoh.abciss++)
            {
                abciss_point = abciss_points[p_aoh.abciss];
                trio_matrix[p_aoh.abciss] = new double[trio_height][];
                for(;p_aoh.ordinate<p_aoh.end_of_ordinate;p_aoh.ordinate++)
                {
                    z.Real=abciss_point;
                    z.Imagine = ordinate_points[p_aoh.ordinate];
                    //z0 = z.getclone();
                    v1 = v2 = v3 = v1total = v1max = v1min = v2total = v2max = v2min = v3total = v3max = v3min = 0D;
                    ratio = (z.Real * z.Real + z.Imagine * z.Imagine);
                    lratio = 0;
                    for(iterations=0;iterations<f_iterations_count&&ratio<400D;iterations++)
                    {
                        lratio = ratio;
                        z = Complex.SSin(z);
                        z.Real += _P.Real;
                        z.Imagine += _P.Imagine;
                        value = Complex.Sec(z);
                        ratio = z.Real*z.Real+z.Imagine*z.Imagine;
                        if (double.IsNaN(value.Real) || double.IsNaN(value.Imagine)) {
                            v1 = v2 = v3 = 0;
                        }
                        else{v1 = value.abs;
                        v2 = value.sqr().abs;
                        v3 = value.Pow(3).abs;
                        v1total += v1;
                        v2total += v2;
                        v3total += v3;
                        if (v1 < v1min) v1min = v1;
                        else if (v1 > v1max) v1max = v1;
                        if (v2 < v2min) v2min = v2;
                        else if (v2 > v2max) v2max = v2;
                        if (v3 < v3min) v3min = v3;
                        else if (v3 > v3max) v3max = v3;}
                    }
                    //$r = (($v1total / $count) - $v1min) / ($v1max - $v1min);
                    Ratio_matrix[p_aoh.abciss][p_aoh.ordinate] = lratio;
                    if (iterations > 0)
                    {
                        trio_matrix[p_aoh.abciss][p_aoh.ordinate] = new double[] {((v1total/(double)iterations)-v1min)/(v1max-v1min),
                        ((v2total/(double)iterations)-v2min)/(v2max-v2min),
                        ((v3total/(double)iterations)-v3min)/(v3max-v3min)};
                    }
                    else trio_matrix[p_aoh.abciss][p_aoh.ordinate] = new double[3];
                    iter_matrix[p_aoh.abciss][p_aoh.ordinate] = iterations;
                }
                p_aoh.ordinate = 0;
                if((--current_percent)==0)
                {
                    current_percent = percent_length;
                    f_new_percent_in_parallel_activate();
                }

            }
        }
开发者ID:asteroidsuper,项目名称:FractalBrowser,代码行数:68,代码来源:AmoebaLasVegas.cs


注:本文中的Complex.Pow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。